From 32a01c43c0d910ac349e3c5c806a7f1811a7179f Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Sat, 1 Feb 2025 23:22:15 +0100 Subject: snorlax2 --- hosts/snorlax/flake.nix | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 hosts/snorlax/flake.nix (limited to 'hosts/snorlax/flake.nix') 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 + 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 + 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`?"; + } + ]; + }; + }; +} -- cgit v1.2.3