{ description = "A very basic flake"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; disko = { url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; }; sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; mysecrets = { url = "git+ssh://gitea@git.unixyourbrain.org/beastie/nixos-secrets.git?ref=main&shallow=1"; # url = "path:/home/beastie/nixos-secrets"; flake = false; }; }; outputs = { ... }@inputs: let mkSystem = pkgs: system: hostname: username: pkgs.lib.nixosSystem { inherit system; pkgs = import pkgs { inherit system; config.allowUnfree = true; }; specialArgs = { inherit hostname username inputs; #hostname = hostname; #username = username; }; # For system modules modules = [ # General configuration, for all machines inputs.sops-nix.nixosModules.sops inputs.disko.nixosModules.disko ./hosts/${hostname}/disk-config.nix ./hosts/${hostname}/hardware-configuration.nix ./modules ]; }; in { nixosConfigurations = { #nixos-anywhere -- --flake './#test-kvm' --generate-hardware-config nixos-generate-config ./hosts/test-kvm/hardware-configuration.nix --target-host root@192.168.122.204 test-kvm = mkSystem inputs.nixpkgs "x86_64-linux" "test-kvm" "beastie"; #live-usb = mkSystem inputs.nixpkgs "x86_64-linux" "live-usb" "beastie"; #nixos-rebuild switch --flake ./#home-nix --sudo home-nix = mkSystem inputs.nixpkgs "x86_64-linux" "home-nix" "beastie"; }; }; }