From 64c9305120b69a365ab3b9289b9a99b65899b6bc Mon Sep 17 00:00:00 2001 From: buffet Date: Tue, 21 May 2024 18:41:45 +0200 Subject: [PATCH 1/3] feat: setup lix binary cache --- flake.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flake.nix b/flake.nix index eaca18e..add4d00 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,14 @@ { nixConfig = { commit-lockfile-summary = "build(flake): update inputs"; + + extra-substituters = [ + "https://cache.lix.systems" + ]; + + extra-trusted-public-keys = [ + "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" + ]; }; inputs = { From bf67950b31e2bcccd7191a7769f06c68e6a3569d Mon Sep 17 00:00:00 2001 From: buffet Date: Tue, 21 May 2024 19:27:35 +0200 Subject: [PATCH 2/3] feat: switch to lix --- flake.lock | 92 +++++++++++++++++++++++++++++++++++++++++ flake.nix | 11 +++++ hosts/alice/default.nix | 2 + 3 files changed, 105 insertions(+) diff --git a/flake.lock b/flake.lock index 494884a..f81df8a 100644 --- a/flake.lock +++ b/flake.lock @@ -101,6 +101,39 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_3" + }, + "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" + } + }, + "flakey-profile": { + "locked": { + "lastModified": 1712898590, + "narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=", + "owner": "lf-", + "repo": "flakey-profile", + "rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d", + "type": "github" + }, + "original": { + "owner": "lf-", + "repo": "flakey-profile", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -143,6 +176,48 @@ "type": "github" } }, + "lix": { + "flake": false, + "locked": { + "lastModified": 1714955862, + "narHash": "sha256-REWlo2RYHfJkxnmZTEJu3Cd/2VM+wjjpPy7Xi4BdDTQ=", + "ref": "refs/tags/2.90-beta.1", + "rev": "b6799ab0374a8e1907a48915d3187e07da41d88c", + "revCount": 15501, + "type": "git", + "url": "https://git@git.lix.systems/lix-project/lix" + }, + "original": { + "ref": "refs/tags/2.90-beta.1", + "type": "git", + "url": "https://git@git.lix.systems/lix-project/lix" + } + }, + "lix-module": { + "inputs": { + "flake-utils": "flake-utils_2", + "flakey-profile": "flakey-profile", + "lix": [ + "lix" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1715885250, + "narHash": "sha256-IUFYAl3158Ig5vySnRBHoPReb2/S97bjodCo6FhzJv4=", + "ref": "refs/heads/main", + "rev": "53d713eb486f21d653af3ef3528e9a19ecfc45e5", + "revCount": 81, + "type": "git", + "url": "https://git.lix.systems/lix-project/nixos-module" + }, + "original": { + "type": "git", + "url": "https://git.lix.systems/lix-project/nixos-module" + } + }, "nix-index-database": { "inputs": { "nixpkgs": [ @@ -284,6 +359,8 @@ "disko": "disko", "flake-utils": "flake-utils", "home-manager": "home-manager", + "lix": "lix", + "lix-module": "lix-module", "nix-index-database": "nix-index-database", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", @@ -323,6 +400,21 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "website": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index add4d00..ecf1455 100644 --- a/flake.nix +++ b/flake.nix @@ -37,6 +37,17 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + lix = { + url = "git+https://git@git.lix.systems/lix-project/lix?ref=refs/tags/2.90-beta.1"; + flake = false; + }; + + lix-module = { + url = "git+https://git.lix.systems/lix-project/nixos-module"; + inputs.lix.follows = "lix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-index-database = { url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/hosts/alice/default.nix b/hosts/alice/default.nix index 20d19c5..f164620 100644 --- a/hosts/alice/default.nix +++ b/hosts/alice/default.nix @@ -1,6 +1,7 @@ { agenix, home-manager, + lix-module, nixos-hardware, nur, pkgs, @@ -11,6 +12,7 @@ ./system.nix agenix.nixosModules.default home-manager.nixosModule + lix-module.nixosModules.default nur.nixosModules.nur ./borg.nix From 4791d6c8a0fbb0897a41f0ce3d19b3a3a7091593 Mon Sep 17 00:00:00 2001 From: buffet Date: Tue, 21 May 2024 20:36:49 +0200 Subject: [PATCH 3/3] build(flake): get rid of duplicate inputs What is systems/default and why does *everyone* depend on it? --- flake.lock | 102 +++++++++-------------------------------------------- flake.nix | 28 ++++++++++++--- 2 files changed, 41 insertions(+), 89 deletions(-) diff --git a/flake.lock b/flake.lock index f81df8a..6f908b6 100644 --- a/flake.lock +++ b/flake.lock @@ -9,7 +9,9 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems" + "systems": [ + "systems" + ] }, "locked": { "lastModified": 1715290355, @@ -85,25 +87,9 @@ }, "flake-utils": { "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" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_3" + "systems": [ + "systems" + ] }, "locked": { "lastModified": 1710146030, @@ -195,7 +181,9 @@ }, "lix-module": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": [ + "flake-utils" + ], "flakey-profile": "flakey-profile", "lix": [ "lix" @@ -269,22 +257,6 @@ "type": "github" } }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1710695816, - "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "614b4613980a522ba49f0d194531beddbb7220d3", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-23.11", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-unstable": { "locked": { "lastModified": 1715961556, @@ -301,22 +273,6 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1710765496, - "narHash": "sha256-p7ryWEeQfMwTB6E0wIUd5V2cFTgq+DRRBz2hYGnJZyA=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e367f7a1fb93137af22a3908f00b9a35e2d286a7", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nur": { "locked": { "lastModified": 1716156347, @@ -336,8 +292,12 @@ "inputs": { "flake-compat": "flake-compat", "gitignore": "gitignore", - "nixpkgs": "nixpkgs_2", - "nixpkgs-stable": "nixpkgs-stable" + "nixpkgs": [ + "nixpkgs-unstable" + ], + "nixpkgs-stable": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1715870890, @@ -367,40 +327,12 @@ "nixpkgs-unstable": "nixpkgs-unstable", "nur": "nur", "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems", "website": "website" } }, "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "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" - } - }, - "systems_3": { + "flake": false, "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", diff --git a/flake.nix b/flake.nix index ecf1455..efb2abf 100644 --- a/flake.nix +++ b/flake.nix @@ -12,18 +12,17 @@ }; inputs = { - flake-utils.url = "github:numtide/flake-utils"; nixos-hardware.url = "github:NixOS/nixos-hardware"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; nur.url = "github:nix-community/NUR"; - pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; agenix = { url = "github:ryantm/agenix"; inputs = { home-manager.follows = "home-manager"; nixpkgs.follows = "nixpkgs"; + systems.follows = "systems"; }; }; @@ -32,6 +31,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + flake-utils = { + url = "github:numtide/flake-utils"; + inputs.systems.follows = "systems"; + }; + home-manager = { url = "github:nix-community/home-manager/release-23.11"; inputs.nixpkgs.follows = "nixpkgs"; @@ -44,8 +48,11 @@ lix-module = { url = "git+https://git.lix.systems/lix-project/nixos-module"; - inputs.lix.follows = "lix"; - inputs.nixpkgs.follows = "nixpkgs"; + inputs = { + flake-utils.follows = "flake-utils"; + lix.follows = "lix"; + nixpkgs.follows = "nixpkgs"; + }; }; nix-index-database = { @@ -53,6 +60,19 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + pre-commit-hooks = { + url = "github:cachix/pre-commit-hooks.nix"; + inputs = { + nixpkgs.follows = "nixpkgs-unstable"; + nixpkgs-stable.follows = "nixpkgs"; + }; + }; + + systems = { + url = "github:nix-systems/default"; + flake = false; + }; + website = { url = "github:buffet/website"; flake = false;