feat(topology): add support

Using `flake-parts` flake module
Import `nix-topology` `NixOS` module by default
This commit is contained in:
reo101 2024-07-19 02:24:20 +03:00
parent 415005d26d
commit b4e7901780
Signed by: reo101
GPG key ID: 675AA7EF13964ACB
3 changed files with 233 additions and 22 deletions

View file

@ -146,6 +146,28 @@
"type": "github" "type": "github"
} }
}, },
"devshell_2": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nix-topology",
"nixpkgs"
]
},
"locked": {
"lastModified": 1713532798,
"narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=",
"owner": "numtide",
"repo": "devshell",
"rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"disko": { "disko": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -279,6 +301,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_8": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@ -399,11 +437,11 @@
"systems": "systems_6" "systems": "systems_6"
}, },
"locked": { "locked": {
"lastModified": 1705309234, "lastModified": 1701680307,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -417,11 +455,11 @@
"systems": "systems_7" "systems": "systems_7"
}, },
"locked": { "locked": {
"lastModified": 1685518550, "lastModified": 1710146030,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -452,6 +490,24 @@
"inputs": { "inputs": {
"systems": "systems_9" "systems": "systems_9"
}, },
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_7": {
"inputs": {
"systems": "systems_10"
},
"locked": { "locked": {
"lastModified": 1705309234, "lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
@ -466,9 +522,27 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_7": { "flake-utils_8": {
"inputs": { "inputs": {
"systems": "systems_10" "systems": "systems_11"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_9": {
"inputs": {
"systems": "systems_12"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1710146030,
@ -556,6 +630,28 @@
} }
}, },
"gitignore_3": { "gitignore_3": {
"inputs": {
"nixpkgs": [
"nix-topology",
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"gitignore_4": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"zls-overlay", "zls-overlay",
@ -891,6 +987,29 @@
"type": "github" "type": "github"
} }
}, },
"nix-topology": {
"inputs": {
"devshell": "devshell_2",
"flake-utils": "flake-utils_4",
"nixpkgs": [
"nixpkgs"
],
"pre-commit-hooks": "pre-commit-hooks_2"
},
"locked": {
"lastModified": 1721160643,
"narHash": "sha256-ZkjJnwgDUkjzgySZv9GjKnDsDmNJVkU2u2pLD4a1QKA=",
"owner": "oddlama",
"repo": "nix-topology",
"rev": "fe9ace7f40a63e3eb9b39a20a1032834e090d806",
"type": "github"
},
"original": {
"owner": "oddlama",
"repo": "nix-topology",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1717868076, "lastModified": 1717868076,
@ -982,6 +1101,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable_2": {
"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_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1721138476, "lastModified": 1721138476,
@ -1127,13 +1262,41 @@
"type": "github" "type": "github"
} }
}, },
"pre-commit-hooks_2": {
"inputs": {
"flake-compat": "flake-compat_7",
"flake-utils": [
"nix-topology",
"flake-utils"
],
"gitignore": "gitignore_3",
"nixpkgs": [
"nix-topology",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1714478972,
"narHash": "sha256-q//cgb52vv81uOuwz1LaXElp3XAe1TqrABXODAEF6Sk=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "2849da033884f54822af194400f8dff435ada242",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"ragenix": { "ragenix": {
"inputs": { "inputs": {
"agenix": [ "agenix": [
"agenix" "agenix"
], ],
"crane": "crane", "crane": "crane",
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_3",
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
@ -1170,6 +1333,7 @@
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nix-monitored": "nix-monitored", "nix-monitored": "nix-monitored",
"nix-on-droid": "nix-on-droid", "nix-on-droid": "nix-on-droid",
"nix-topology": "nix-topology",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nur": "nur", "nur": "nur",
"ragenix": "ragenix", "ragenix": "ragenix",
@ -1206,7 +1370,7 @@
}, },
"rust-overlay_2": { "rust-overlay_2": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_5", "flake-utils": "flake-utils_7",
"nixpkgs": "nixpkgs_5" "nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
@ -1241,7 +1405,7 @@
}, },
"spicetify-nix": { "spicetify-nix": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_6",
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
@ -1288,6 +1452,36 @@
"type": "github" "type": "github"
} }
}, },
"systems_11": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_12": {
"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": { "systems_2": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
@ -1450,8 +1644,8 @@
}, },
"zig-overlay": { "zig-overlay": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_7", "flake-compat": "flake-compat_8",
"flake-utils": "flake-utils_6", "flake-utils": "flake-utils_8",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
@ -1472,8 +1666,8 @@
}, },
"zls-overlay": { "zls-overlay": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_7", "flake-utils": "flake-utils_9",
"gitignore": "gitignore_3", "gitignore": "gitignore_4",
"langref": "langref", "langref": "langref",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"

View file

@ -45,6 +45,11 @@
url = "github:nix-community/impermanence"; url = "github:nix-community/impermanence";
}; };
nix-topology = {
url = "github:oddlama/nix-topology";
inputs.nixpkgs.follows = "nixpkgs";
};
lib-net = { lib-net = {
url = "https://gist.github.com/duairc/5c9bb3c922e5d501a1edb9e7b3b845ba/archive/3885f7cd9ed0a746a9d675da6f265d41e9fd6704.tar.gz"; url = "https://gist.github.com/duairc/5c9bb3c922e5d501a1edb9e7b3b845ba/archive/3885f7cd9ed0a746a9d675da6f265d41e9fd6704.tar.gz";
flake = false; flake = false;
@ -128,12 +133,10 @@
}; };
}; };
outputs = outputs = inputs: let
inputs: inherit (inputs) self;
let inherit (self) outputs;
inherit (inputs) self; in
inherit (self) outputs;
in
inputs.flake-parts.lib.mkFlake { inherit inputs; } ({ withSystem, flake-parts-lib, ... }: { inputs.flake-parts.lib.mkFlake { inherit inputs; } ({ withSystem, flake-parts-lib, ... }: {
systems = [ systems = [
"aarch64-linux" "aarch64-linux"
@ -145,6 +148,8 @@
imports = [ imports = [
inputs.agenix-rekey.flakeModule inputs.agenix-rekey.flakeModule
inputs.nix-topology.flakeModule
] ++ [
./nix/machines.nix ./nix/machines.nix
./nix/modules.nix ./nix/modules.nix
./nix/configurations.nix ./nix/configurations.nix
@ -154,7 +159,9 @@
perSystem = { lib, pkgs, system, ... }: { perSystem = { lib, pkgs, system, ... }: {
_module.args.pkgs = import inputs.nixpkgs { _module.args.pkgs = import inputs.nixpkgs {
inherit system; inherit system;
overlays = lib.attrValues outputs.overlays; overlays = lib.attrValues outputs.overlays ++ [
inputs.nix-topology.overlays.default
];
config = { }; config = { };
}; };
@ -170,6 +177,15 @@
# Formatter (`nix fmt`) # Formatter (`nix fmt`)
formatter = pkgs.nixpkgs-fmt; formatter = pkgs.nixpkgs-fmt;
topology = {
modules = [
];
nixosConfigurations = {
inherit (self.nixosConfigurations)
jeeves;
};
};
agenix-rekey = { agenix-rekey = {
nodes = { nodes = {
inherit (self.nixosConfigurations) jeeves; inherit (self.nixosConfigurations) jeeves;

View file

@ -18,6 +18,7 @@ let
modules = [ modules = [
(lib.path.append root "configuration.nix") (lib.path.append root "configuration.nix")
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
inputs.nix-topology.nixosModules.default
{ {
nixpkgs.overlays = builtins.attrValues self.overlays; nixpkgs.overlays = builtins.attrValues self.overlays;
} }