summaryrefslogtreecommitdiff
path: root/hosts/snorlax/flake.nix
diff options
context:
space:
mode:
authorJasper Ras <jaspert.ras@gmail.com>2025-02-01 23:22:15 +0100
committerJasper Ras <jaspert.ras@gmail.com>2025-02-01 23:22:15 +0100
commit32a01c43c0d910ac349e3c5c806a7f1811a7179f (patch)
tree2fb0ae8902dd85807387fba9aecd618bb8631741 /hosts/snorlax/flake.nix
parent24eb87d36b150f6364b843bbd9483c8586755354 (diff)
snorlax2
Diffstat (limited to 'hosts/snorlax/flake.nix')
-rw-r--r--hosts/snorlax/flake.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/hosts/snorlax/flake.nix b/hosts/snorlax/flake.nix
new file mode 100644
index 0000000..49f2c4f
--- /dev/null
+++ b/hosts/snorlax/flake.nix
@@ -0,0 +1,44 @@
+{
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+ inputs.disko.url = "github:nix-community/disko";
+ inputs.disko.inputs.nixpkgs.follows = "nixpkgs";
+ inputs.nixos-facter-modules.url = "github:numtide/nixos-facter-modules";
+
+ outputs =
+ {
+ nixpkgs,
+ disko,
+ nixos-facter-modules,
+ ...
+ }:
+ {
+ # Use this for all other targets
+ # nixos-anywhere --flake .#generic-nixos-facter --generate-hardware-config nixos-generate-config ./hardware-configuration.nix <hostname>
+ nixosConfigurations.generic = nixpkgs.lib.nixosSystem {
+ system = "x86_64-linux";
+ modules = [
+ disko.nixosModules.disko
+ ./configuration.nix
+ ./hardware-configuration.nix
+ ];
+ };
+
+ # Slightly experimental: Like generic, but with nixos-facter (https://github.com/numtide/nixos-facter)
+ # nixos-anywhere --flake .#generic-nixos-facter --generate-hardware-config nixos-facter facter.json <hostname>
+ nixosConfigurations.generic-nixos-facter = nixpkgs.lib.nixosSystem {
+ system = "x86_64-linux";
+ modules = [
+ disko.nixosModules.disko
+ ./configuration.nix
+ nixos-facter-modules.nixosModules.facter
+ {
+ config.facter.reportPath =
+ if builtins.pathExists ./facter.json then
+ ./facter.json
+ else
+ throw "Have you forgotten to run nixos-anywhere with `--generate-hardware-config nixos-facter ./facter.json`?";
+ }
+ ];
+ };
+ };
+}