From 457f70f404ce0c146dd67320710aa4fba6a8b725 Mon Sep 17 00:00:00 2001 From: winston Date: Sun, 24 Dec 2023 04:17:20 +0100 Subject: [PATCH] build: the very cool new features commit also need to remember to nixpkgs-unstable -> nixos-unstable at a later point --- .justfile | 14 ++++--- flake.lock | 74 +++++++++++++++++----------------- flake.nix | 6 ++- machines/common/shared/nix.nix | 2 +- scripts/fetch.sh | 6 +++ 5 files changed, 56 insertions(+), 46 deletions(-) create mode 100755 scripts/fetch.sh diff --git a/.justfile b/.justfile index 94a862f..e78b8f5 100644 --- a/.justfile +++ b/.justfile @@ -11,10 +11,7 @@ export NIX_CONFIG := " [private] [macos] rebuild *args: - #!/usr/bin/env -S bash -euo pipefail - dir="${TMPDIR:-/tmp}/nix-darwin" - ! [[ -x "$dir/sw/bin/darwin-rebuild" ]] && nom build .\#darwinConfigurations.`hostname`.system -o "$dir" - "$dir/sw/bin/darwin-rebuild" --flake . {{args}} + darwin-rebuild --flake . {{args}} [private] [linux] @@ -42,7 +39,12 @@ check *args: switch *args: @just build {{args}} - @gum confirm && just rebuild switch {{args}} + @just confirm-switch {{args}} + +[confirm] +[private] +confirm-switch *args: + @just rebuild switch {{args}} clean: sudo nix-env --profile /nix/var/nix/profiles/system --delete-generations old @@ -50,4 +52,4 @@ clean: nix store optimise fetch: - @nix shell nixpkgs\#onefetch nixpkgs\#scc -c sh -c "onefetch --true-color never --no-bots -d lines-of-code && scc --no-cocomo ." + @./scripts/fetch.sh diff --git a/flake.lock b/flake.lock index 135c5b3..a935b5f 100644 --- a/flake.lock +++ b/flake.lock @@ -27,11 +27,11 @@ ] }, "locked": { - "lastModified": 1700795494, - "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", + "lastModified": 1703271201, + "narHash": "sha256-9uB7x1XP+/+We4mYpxC8UMgxlC0efP6P+4dsgqFuxCU=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", + "rev": "010a625bd74bc623153344f52f71cc965b31d75a", "type": "github" }, "original": { @@ -81,11 +81,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -122,11 +122,11 @@ ] }, "locked": { - "lastModified": 1701728041, - "narHash": "sha256-x0pyrI1vC8evVDxCxyO6olOyr4wlFg9+VS3C3p4xFYQ=", + "lastModified": 1703368619, + "narHash": "sha256-ZGPMYL7FMA6enhuwby961bBANmoFX14EA86m2/Jw5Jo=", "owner": "nix-community", "repo": "home-manager", - "rev": "ac7216918cd65f3824ba7817dea8f22e61221eaf", + "rev": "a2523ea0343b056ba240abbac90ab5f116a7aa7b", "type": "github" }, "original": { @@ -142,11 +142,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1701759813, - "narHash": "sha256-sFbRwDHO/5ufWRrvs/XLvTjy+yCqidplk9A51MywGFU=", + "lastModified": 1703228608, + "narHash": "sha256-V/2ieXghm6ZgvADR7zaif/+xQTcLijiHELHAjwV2GlU=", "owner": "nekowinston", "repo": "nur", - "rev": "519d6c6b0064e7ea93f0acd168e4488556ca95b8", + "rev": "307c443ff60ee65747bacd75736651b3de90c868", "type": "github" }, "original": { @@ -162,11 +162,11 @@ ] }, "locked": { - "lastModified": 1701572887, - "narHash": "sha256-oCPwQZT0Inis4zcYhtFHUp7Rym1zglKPLDcRird35q8=", + "lastModified": 1702864432, + "narHash": "sha256-xR5Igg2hnm979W3YgMDrSjErHFhHo4rbMboF6DC0mbc=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "41afa8d1c061beda68502bcc67f2788f3a77042b", + "rev": "4605ccd764fac78b9e4b5b058698cb9f04430b91", "type": "github" }, "original": { @@ -186,11 +186,11 @@ ] }, "locked": { - "lastModified": 1701825722, - "narHash": "sha256-vpT4hY8DDu39b9AMKCJIEVgQSfm+QKDGUjpVPFxNhTs=", + "lastModified": 1703380950, + "narHash": "sha256-ShXr/nYaz2auifzENt2BOwrMMUTRv4kNw7OmYzpTr4U=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "8f5a362c9ea3824d70458485abf9d162b8765034", + "rev": "34c4e14caec3f17f7c4d006044a7e781b961ceec", "type": "github" }, "original": { @@ -201,11 +201,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1701253981, - "narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=", + "lastModified": 1702312524, + "narHash": "sha256-gkZJRDBUCpTPBvQk25G0B7vfbpEYM5s5OZqghkjZsnE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58", + "rev": "a9bf124c46ef298113270b1f84a164865987a91c", "type": "github" }, "original": { @@ -235,27 +235,27 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1701436327, - "narHash": "sha256-tRHbnoNI8SIM5O5xuxOmtSLnswEByzmnQcGGyNRjxsE=", + "lastModified": 1703134684, + "narHash": "sha256-SQmng1EnBFLzS7WSRyPM9HgmZP2kLJcPAz+Ug/nug6o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "91050ea1e57e50388fa87a3302ba12d188ef723a", + "rev": "d6863cbcbbb80e71cecfc03356db1cda38919523", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, "nur": { "locked": { - "lastModified": 1701887101, - "narHash": "sha256-noDEwz+/eMQ3wdVML9XJOu9MiN40IoDDMOvsqSi83Pk=", + "lastModified": 1703384627, + "narHash": "sha256-VrpnDTE0InnTL+STgMk8OTCnzdVRV0gwaVgSEYCsXNE=", "owner": "nix-community", "repo": "nur", - "rev": "d2163cf91fb3fd644539aeddd9ca8af12ac97e70", + "rev": "65caee0fd028c20a22aa98aa25af47381dea0402", "type": "github" }, "original": { @@ -279,11 +279,11 @@ ] }, "locked": { - "lastModified": 1700922917, - "narHash": "sha256-ej2fch/T584b5K9sk1UhmZF7W6wEfDHuoUYpFN8dtvM=", + "lastModified": 1702456155, + "narHash": "sha256-I2XhXGAecdGlqi6hPWYT83AQtMgL+aa3ulA85RAEgOk=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "e5ee5c5f3844550c01d2131096c7271cec5e9b78", + "rev": "007a45d064c1c32d04e1b8a0de5ef00984c419bc", "type": "github" }, "original": { @@ -321,11 +321,11 @@ ] }, "locked": { - "lastModified": 1701569797, - "narHash": "sha256-ObvQFAPpC5IVbI2GHedSTQVzYxht2qhBgHHQnh3mYTs=", + "lastModified": 1702779466, + "narHash": "sha256-IZeGwmm5n6bn+f4aEwMdbzFsJaa219efYZass7pdNdg=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "516c9477757b628b157780d96d84e8c82b46dc99", + "rev": "d74fd31da8994c7e60850561a64379324c1c77dd", "type": "github" }, "original": { @@ -366,11 +366,11 @@ ] }, "locked": { - "lastModified": 1701625569, - "narHash": "sha256-DRrH6EO/fzHe8mHZLiVSgFN98b5CexHwi3EsQm7bjHk=", + "lastModified": 1703225289, + "narHash": "sha256-1jRIcmRcdkdFM7LIur7eCFP9/E7fPmikZSvm9Sbfz/c=", "owner": "willpower3309", "repo": "swayfx", - "rev": "7c8d46bbaa9929a5b4cd1be6fd994a3be09a6eef", + "rev": "ca42d414536c167f951e23bfc50d5edabb6f9dc2", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index e1d4cba..69b024e 100644 --- a/flake.nix +++ b/flake.nix @@ -74,7 +74,9 @@ }; devShells.default = config.pre-commit.devShell.overrideAttrs (old: { - buildInputs = with pkgs; [alejandra gum just nil nix-output-monitor nvd]; + buildInputs = with pkgs; + [alejandra just nil nix-output-monitor nvd] + ++ lib.optionals stdenv.isDarwin [inputs.darwin.packages.${system}.darwin-rebuild]; }); legacyPackages.homeConfigurations = let @@ -113,7 +115,7 @@ }; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; darwin = { url = "github:lnl7/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/machines/common/shared/nix.nix b/machines/common/shared/nix.nix index a4d6e3c..d301716 100644 --- a/machines/common/shared/nix.nix +++ b/machines/common/shared/nix.nix @@ -11,7 +11,7 @@ in { nixpkgs.config.allowUnfree = true; nix = { gc.automatic = true; - package = pkgs.nixVersions.nix_2_16; + package = pkgs.nixVersions.nix_2_19; settings = { auto-optimise-store = pkgs.stdenv.isLinux; diff --git a/scripts/fetch.sh b/scripts/fetch.sh new file mode 100755 index 0000000..21a8092 --- /dev/null +++ b/scripts/fetch.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env nix +#!nix shell nixpkgs#onefetch nixpkgs#scc --command bash +# shellcheck shell=bash +set -euo pipefail +onefetch --true-color never --no-bots -d lines-of-code +scc --no-cocomo .