This commit is contained in:
2024-03-21 16:29:09 -05:00
parent ceada8a46b
commit 51e7f52bb0
10 changed files with 584 additions and 76 deletions

View File

@@ -16,6 +16,12 @@
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelParams = ["quiet"];
services.avahi = {
enable = true;
nssmdns = true;
openFirewall = true;
};
boot.initrd.luks.devices."luks-db49c136-7de8-4ab6-8e05-754bab13925d".device = "/dev/disk/by-uuid/db49c136-7de8-4ab6-8e05-754bab13925d";
networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
@@ -27,6 +33,10 @@
# Enable networking
networking.networkmanager.enable = true;
hardware.opengl.extraPackages = with pkgs; [
amdvlk
];
# Set your time zone.
time.timeZone = "America/Chicago";
environment.sessionVariables.NIXOS_OZONE_WL = "1";
@@ -54,11 +64,10 @@
};
# Enable the GNOME Desktop Environment.
services.xserver.desktopManager.plasma5.enable = true;
services.xserver.displayManager.sddm.enable = true;
services.xserver.displayManager.sddm.wayland.enable = true;
programs.hyprland.enable = true;
services.xserver.desktopManager.plasma6.enable = true;
services.displayManager.cosmic-greeter.enable = true;
services.desktopManager.cosmic.enable = true;
# services.xserver.displayManager.cosmic-greeter.enable = true;
# Configure keymap in X11
services.xserver = {
layout = "us";
@@ -124,46 +133,40 @@
dunst
just
steamtinkerlaunch
cosmic-icons
cosmic-settings
cosmic-comp
cargo
kdePackages.kalk
kdePackages.kdenlive
fuse
ntfs3g
(callPackage ./pkgs/warp {})
lapce
kdePackages.elisa
glaxnimate
mlt
qt5.full
dconf
libsForQt5.polonium
sublime-music
spacedrive
openjdk
gamescope
playerctl
xdg-desktop-portal
cosmic-panel
wine
bottles
cava
cosmic-session
pop-icon-theme
pop-launcher
gnome.gnome-tweaks
libreoffice
hunspell
hunspellDicts.en_US
cosmic-applets
cosmic-settings
cosmic-icons
cosmic-protocols
neovide
cosmic-design-demo
flatpak
rofi-wayland
xdg-desktop-portal-cosmic
cosmic-bg
cosmic-osd
polkit-kde-agent
cosmic-term
gradience
cosmic-edit
cosmic-randr
cosmic-files
cosmic-greeter
cosmic-launcher
cosmic-screenshot
cosmic-applibrary
cosmic-notifications
cosmic-settings-daemon
cosmic-workspaces-epoch
];
# Enable Steam
programs.steam = {
enable = true;

243
flake.lock generated
View File

@@ -1,6 +1,58 @@
{
"nodes": {
"devshell": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1710156081,
"narHash": "sha256-4PMY6aumJi5dLFjBzF5O4flKXmadMNq3AGUHKYfchh0=",
"owner": "numtide",
"repo": "devshell",
"rev": "bc68b058dc7e6d4d6befc4ec6c60082b6e844b7d",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1688025799,
"narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=",
"owner": "nix-community",
"repo": "flake-compat",
"rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"revCount": 57,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@@ -17,6 +69,28 @@
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixos-cosmic",
"nix-update",
"nixpkgs"
]
},
"locked": {
"lastModified": 1698882062,
"narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "8c9fa2545007b49a5db5f650ae91f227672c3877",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
@@ -24,11 +98,11 @@
]
},
"locked": {
"lastModified": 1706830856,
"narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=",
"lastModified": 1709336216,
"narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f",
"rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2",
"type": "github"
},
"original": {
@@ -55,6 +129,24 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
@@ -64,11 +156,11 @@
]
},
"locked": {
"lastModified": 1703887061,
"narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=",
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
@@ -84,11 +176,11 @@
]
},
"locked": {
"lastModified": 1707175763,
"narHash": "sha256-0MKHC6tQ4KEuM5rui6DjKZ/VNiSANB4E+DJ/+wPS1PU=",
"lastModified": 1710974515,
"narHash": "sha256-jZpdsypecYTOO9l12Vy77otGmh9uz8tGzcguifA30Vs=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f99eace7c167b8a6a0871849493b1c613d0f1b80",
"rev": "1c2acec99933f9835cc7ad47e35303de92d923a4",
"type": "github"
},
"original": {
@@ -105,11 +197,11 @@
]
},
"locked": {
"lastModified": 1706955260,
"narHash": "sha256-W3y0j77IDVbmbajudHoUr46RpswujUCl+D5Vru53UsI=",
"lastModified": 1710820906,
"narHash": "sha256-2bNMraoRB4pdw/HtxgYTFeMhEekBZeQ53/a8xkqpbZc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "880d9bc2110f7cae59698f715b8ca42cdc53670c",
"rev": "022464438a85450abb23d93b91aa82e0addd71fb",
"type": "github"
},
"original": {
@@ -120,11 +212,11 @@
},
"master": {
"locked": {
"lastModified": 1707331569,
"narHash": "sha256-4qcqSPZq5lpXnybVNe876EJRDyK9J5QsiL9800aCHM8=",
"lastModified": 1711042203,
"narHash": "sha256-b5QKC84by59cvBKS92iBNcvHmsXD7+T6bkKxUOVg6no=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f3767a143e11491eed7401d5f5abf4f9150dc3c8",
"rev": "c2684b4d2d650dce7923a7e5d44ad7b8fa44aefd",
"type": "github"
},
"original": {
@@ -142,11 +234,11 @@
]
},
"locked": {
"lastModified": 1706833576,
"narHash": "sha256-w7BL0EWRts+nD1lbLECIuz6fRzmmV+z8oWwoY7womR0=",
"lastModified": 1710717205,
"narHash": "sha256-Wf3gHh5uV6W1TV/A8X8QJf99a5ypDSugY4sNtdJDe0A=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "bdbae6ecff8fcc322bf6b9053c0b984912378af7",
"rev": "bcc8afd06e237df060c85bad6af7128e05fd61a3",
"type": "github"
},
"original": {
@@ -155,25 +247,72 @@
"type": "github"
}
},
"nix-update": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": [
"nixos-cosmic",
"nixpkgs"
],
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1709726721,
"narHash": "sha256-N0KdNvaWZF2Wn/sQgIpXzXYaYiSQcVxi7P3H/uoSkcg=",
"owner": "lilyinstarlight",
"repo": "nix-update",
"rev": "816d30da62f6a04fcbde8312246204920f73e7ae",
"type": "github"
},
"original": {
"owner": "lilyinstarlight",
"ref": "tmp/fixed",
"repo": "nix-update",
"type": "github"
}
},
"nixos-cosmic": {
"inputs": {
"flake-compat": "flake-compat",
"nix-update": "nix-update",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1710982899,
"narHash": "sha256-W/uU62m9oVSizVwQJrQoHeXEv12xs4gk0CbXaizXVoA=",
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"rev": "00423f29206fcaded8296d87320b454166601da9",
"type": "github"
},
"original": {
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1707092692,
"narHash": "sha256-ZbHsm+mGk/izkWtT4xwwqz38fdlwu7nUUKXTOmm4SyE=",
"lastModified": 1710806803,
"narHash": "sha256-qrxvLS888pNJFwJdK+hf1wpRCSQcqA6W5+Ox202NDa0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "faf912b086576fd1a15fca610166c98d47bc667e",
"rev": "b06025f1533a1e07b6db3e75151caa155d1c7eb3",
"type": "github"
},
"original": {
"owner": "NixOS",
"id": "nixpkgs",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
"type": "indirect"
}
},
"nixvim": {
"inputs": {
"flake-parts": "flake-parts",
"devshell": "devshell",
"flake-compat": "flake-compat_2",
"flake-parts": "flake-parts_2",
"home-manager": "home-manager_2",
"nix-darwin": "nix-darwin",
"nixpkgs": [
@@ -182,11 +321,11 @@
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1707312238,
"narHash": "sha256-grc7yArqgDBuRcMBsjOFD4GfSEYbyCKd/W3y0Gqm9wE=",
"lastModified": 1710936779,
"narHash": "sha256-ecYnUzSWqRae10pp7J6ZE2BznTPJ9f8sLiIoDBQtRBw=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "2e18333dd2c696241cde0f6aa0632738dff10c15",
"rev": "4f6e90212c7ec56d7c03611fb86befa313e7f61f",
"type": "github"
},
"original": {
@@ -197,8 +336,8 @@
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_2",
"gitignore": "gitignore",
"nixpkgs": [
"nixvim",
@@ -210,11 +349,11 @@
]
},
"locked": {
"lastModified": 1706424699,
"narHash": "sha256-Q3RBuOpZNH2eFA1e+IHgZLAOqDD9SKhJ/sszrL8bQD4=",
"lastModified": 1710843117,
"narHash": "sha256-b6iKQeHegzpc697rxTPA3bpwGN3m50eLCgdQOmceFuE=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "7c54e08a689b53c8a1e5d70169f2ec9e2a68ffaf",
"rev": "e8dc1b4fe80c6fcededde7700e6a23bcdf7f3347",
"type": "github"
},
"original": {
@@ -227,6 +366,7 @@
"inputs": {
"home-manager": "home-manager",
"master": "master",
"nixos-cosmic": "nixos-cosmic",
"nixpkgs": "nixpkgs",
"nixvim": "nixvim"
}
@@ -245,6 +385,43 @@
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixos-cosmic",
"nix-update",
"nixpkgs"
]
},
"locked": {
"lastModified": 1698438538,
"narHash": "sha256-AWxaKTDL3MtxaVTVU5lYBvSnlspOS0Fjt8GxBgnU0Do=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "5deb8dc125a9f83b65ca86cf0c8167c46593e0b1",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",

View File

@@ -2,7 +2,11 @@
description = "My flakes configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "nixpkgs/nixos-unstable";
nixos-cosmic = {
url = "github:lilyinstarlight/nixos-cosmic";
inputs.nixpkgs.follows = "nixpkgs";
};
master.url = "github:NixOS/nixpkgs/master";
home-manager.url = "github:nix-community/home-manager";
nixvim = {
@@ -12,13 +16,21 @@
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, home-manager, master, nixvim }@inputs:
outputs = { self, nixpkgs, nixos-cosmic, home-manager, master, nixvim }@inputs:
{
nixosConfigurations = {
nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {inherit nixvim;};
modules = [ ./configuration.nix
modules = [
{
nix.settings = {
substituters = [ "https://cosmic.cachix.org/" ];
trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ];
};
}
nixos-cosmic.nixosModules.default
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useUserPackages = true;

View File

@@ -28,13 +28,6 @@
services.mpd-mpris.enable = true;
gtk = {
enable = true;
theme.package = pkgs.adw-gtk3;
theme.name = "adw-gtk3";
iconTheme.package = pkgs.rose-pine-icon-theme;
iconTheme.name = "rose-pine-icons";
};
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage

View File

@@ -0,0 +1,52 @@
{ config, pkgs, lib, ... }:
let
cfg = config.services.xserver.displayManager.cosmic-greeter;
in
{
meta.maintainers = with lib.maintainers; [ nyanbinary ];
options.services.xserver.displayManager.cosmic-greeter = {
enable = lib.mkEnableOption (lib.mdDoc "COSMIC greeter");
};
config = lib.mkIf cfg.enable {
services.greetd = {
enable = true;
settings = {
default_session = {
user = "cosmic-greeter";
command = "${pkgs.coreutils}/bin/env XCURSOR_THEME=Pop systemd-cat -t cosmic-greeter ${pkgs.cosmic-comp}/bin/cosmic-comp ${pkgs.cosmic-greeter}/bin/cosmic-greeter";
};
};
};
systemd.services.cosmic-greeter-daemon = {
wantedBy = [ "multi-user.target" ];
before = [ "greetd.service" ];
serviceConfig = {
ExecStart = "${pkgs.cosmic-greeter}/bin/cosmic-greeter-daemon";
Restart = "on-failure";
};
};
systemd.tmpfiles.rules = [
"d '/var/lib/cosmic-greeter' - cosmic-greeter cosmic-greeter - -"
];
users.users.cosmic-greeter = {
isSystemUser = true;
home = "/var/lib/cosmic-greeter";
group = "cosmic-greeter";
};
users.groups.cosmic-greeter = { };
hardware.opengl.enable = true;
services.xserver.libinput.enable = true;
security.pam.services.cosmic-greeter = {};
services.dbus.packages = with pkgs; [ cosmic-greeter ];
};
}

84
modules/cosmic/cosmic.nix Normal file
View File

@@ -0,0 +1,84 @@
{ config, pkgs, lib, ... }:
let
cfg = config.services.xserver.desktopManager.cosmic;
in
{
meta.maintainers = with lib.maintainers; [ nyanbinary ];
options.services.xserver.desktopManager.cosmic = {
enable = lib.mkEnableOption (lib.mdDoc "COSMIC desktop environment");
};
config = lib.mkIf cfg.enable {
# seed configuration in nixos-generate-config
system.nixos-generate-config.desktopConfiguration = [''
# Enable the COSMIC Desktop Environment.
services.xserver.displayManager.cosmic-greeter.enable = true;
services.xserver.desktopManager.cosmic.enable = true;
''];
# environment packages
environment.pathsToLink = [ "/share/cosmic" ];
environment.systemPackages = with pkgs; [
gnome.adwaita-icon-theme
cosmic-applibrary
cosmic-applets
cosmic-bg
cosmic-comp
cosmic-edit
cosmic-files
cosmic-greeter
cosmic-icons
cosmic-launcher
cosmic-notifications
cosmic-osd
cosmic-panel
cosmic-randr
cosmic-screenshot
cosmic-session
cosmic-settings
cosmic-settings-daemon
cosmic-term
cosmic-workspaces-epoch
hicolor-icon-theme
pop-icon-theme
pop-launcher
];
# xdg portal packages and config
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-cosmic
xdg-desktop-portal-gtk
];
configPackages = with pkgs; [
xdg-desktop-portal-cosmic
];
};
# fonts
fonts.packages = with pkgs; [
fira-mono
];
# required features
hardware.opengl.enable = true;
services.xserver.libinput.enable = true;
# optional features
hardware.pulseaudio.enable = lib.mkDefault true;
# required dbus services
services.upower.enable = true;
security.polkit.enable = true;
# session packages
services.xserver.displayManager.sessionPackages = with pkgs; [ cosmic-session ];
systemd.packages = with pkgs; [ cosmic-session ];
# required for screen locker
security.pam.services.cosmic-greeter = {};
};
}

View File

@@ -3,7 +3,7 @@
{
programs.nixvim = {
enable = true;
colorschemes.rose-pine.enable = true;
colorschemes.nord.enable = true;
plugins.nvim-tree.enable = true;
plugins.treesitter.enable = true;
plugins.lualine.enable = true;

103
pkgs/warp/default.nix Normal file
View File

@@ -0,0 +1,103 @@
{ lib
, stdenvNoCC
, stdenv
, fetchurl
, autoPatchelfHook
, undmg
, zstd
, curl
, fontconfig
, libglvnd
, libxkbcommon
, vulkan-loader
, xdg-utils
, xorg
, zlib
}:
let
pname = "warp-terminal";
versions = lib.importJSON ./versions.json;
passthru.updateScript = ./update.sh;
linux = stdenv.mkDerivation (finalAttrs: {
inherit pname meta passthru;
inherit (versions.linux) version;
src = fetchurl {
inherit (versions.linux) hash;
url = "https://releases.warp.dev/stable/v${finalAttrs.version}/warp-terminal-v${finalAttrs.version}-1-x86_64.pkg.tar.zst";
};
sourceRoot = ".";
postPatch = ''
substituteInPlace usr/bin/warp-terminal \
--replace-fail /opt/ $out/opt/
'';
nativeBuildInputs = [ autoPatchelfHook zstd ];
buildInputs = [
curl
fontconfig
stdenv.cc.cc.lib # libstdc++.so libgcc_s.so
zlib
];
runtimeDependencies = [
libglvnd # for libegl
libxkbcommon
stdenv.cc.libc
vulkan-loader
xdg-utils
xorg.libX11
xorg.libxcb
xorg.libXcursor
xorg.libXi
];
installPhase = ''
runHook preInstall
mkdir $out
cp -r opt usr/* $out
runHook postInstall
'';
});
darwin = stdenvNoCC.mkDerivation (finalAttrs: {
inherit pname meta passthru;
inherit (versions.darwin) version;
src = fetchurl {
inherit (versions.darwin) hash;
url = "https://releases.warp.dev/stable/v${finalAttrs.version}/Warp.dmg";
};
sourceRoot = ".";
nativeBuildInputs = [ undmg ];
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
cp -r *.app $out/Applications
runHook postInstall
'';
});
meta = with lib; {
description = "Rust-based terminal";
homepage = "https://www.warp.dev";
license = licenses.unfree;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
maintainers = with maintainers; [ emilytrau Enzime imadnyc ];
platforms = platforms.darwin ++ [ "x86_64-linux" ];
};
in
if stdenvNoCC.isDarwin
then darwin
else linux

74
pkgs/warp/update.sh Executable file
View File

@@ -0,0 +1,74 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p cacert curl jq nix moreutils --pure
#shellcheck shell=bash
set -eu -o pipefail
dirname="$(dirname "$0")"
err() {
echo "$*" >&2
exit 1
}
json_get() {
jq -r "$1" < "$dirname/versions.json"
}
json_set() {
jq --arg x "$2" "$1 = \$x" < "$dirname/versions.json" | sponge "$dirname/versions.json"
}
resolve_url() {
local pkg sfx url
local -i i max_redirects
case "$1" in
darwin)
pkg=macos
sfx=dmg
;;
linux)
pkg=pacman
sfx=pkg.tar.zst
;;
*)
err "Unexpected download type: $1"
;;
esac
url="https://app.warp.dev/download?package=${pkg}"
((max_redirects = 15))
for ((i = 0; i < max_redirects; i++)); do
url=$(curl -s -o /dev/null -w '%{redirect_url}' "${url}")
[[ ${url} != *.${sfx} ]] || break
done
((i < max_redirects)) || { err "too many redirects"; }
echo "${url}"
}
get_version() {
echo "$1" | grep -oP -m 1 '(?<=/v)[\d.\w]+(?=/)'
}
# nix-prefect-url seems to be uncompressing the archive then taking the hash
# so just get the hash from fetchurl
sri_get() {
local ouput sri
output=$(nix-build --expr \
'with import <nixpkgs>{};
fetchurl {
url = "'"$1"'";
}' 2>&1 || true)
sri=$(echo "$output" | awk '/^\s+got:\s+/{ print $2 }')
[[ -z "$sri" ]] && err "$output"
echo "$sri"
}
for sys in darwin linux; do
url=$(resolve_url ${sys})
version=$(get_version "${url}")
if [[ ${version} != "$(json_get ".${sys}.version")" ]]; then
sri=$(sri_get "${url}")
json_set ".${sys}.version" "${version}"
json_set ".${sys}.hash" "${sri}"
fi
done

10
pkgs/warp/versions.json Normal file
View File

@@ -0,0 +1,10 @@
{
"darwin": {
"hash": "sha256-GgaRlROSWYZgFlH0bH6PTnRE3L/bb0kX0P6m7nmPlsY=",
"version": "0.2024.03.12.08.02.stable_01"
},
"linux": {
"hash": "sha256-9reFBIu32TzxE46c3PBVzkZYaMV4HVDASvTAVQltYN0=",
"version": "0.2024.03.12.08.02.stable_01"
}
}