diff --git a/flake.nix b/flake.nix index 0738a972..df1ce127 100644 --- a/flake.nix +++ b/flake.nix @@ -422,6 +422,10 @@ path = ./templates/basic-overlay-flake; description = "Basic overlay as a flake"; }; + sample-nixos-template = { + path = ./templates/sample-nixos-template; + description = "Simple sample Nix flake with NixOS and home-manager"; + }; }; # No amount of formatters will make this codebase nicer but it sure does diff --git a/templates/sample-nixos-template/flake.nix b/templates/sample-nixos-template/flake.nix new file mode 100644 index 00000000..265d1382 --- /dev/null +++ b/templates/sample-nixos-template/flake.nix @@ -0,0 +1,22 @@ +{ + description = "Very simple sample of a Nix flake with NixOS and home-manager"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + home-manager.url = "github:nix-community/home-manager"; + }; + + outputs = { nixpkgs, home-manager, ... }: let + system = "x85_64-linux"; + in { + nixosConfigurations.desktop = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ ./hosts/desktop ]; + }; + + homeConfigurations.foodogsquared = home-manager.lib.homeManagerConfiguration { + pkgs = import nixpkgs { inherit system; }; + modules = [ ./users/foodogsquared ]; + }; + }; +} diff --git a/templates/sample-nixos-template/hosts/desktop/default.nix b/templates/sample-nixos-template/hosts/desktop/default.nix new file mode 100644 index 00000000..1fe0bb30 --- /dev/null +++ b/templates/sample-nixos-template/hosts/desktop/default.nix @@ -0,0 +1,5 @@ +{ config, lib, pkgs, ... }: + +{ + system.stateVersion = "23.05"; +} diff --git a/templates/sample-nixos-template/users/foodogsquared/default.nix b/templates/sample-nixos-template/users/foodogsquared/default.nix new file mode 100644 index 00000000..853c9636 --- /dev/null +++ b/templates/sample-nixos-template/users/foodogsquared/default.nix @@ -0,0 +1,5 @@ +{ config, lib, pkgs, ... }: + +{ + home.stateVersion = "23.05"; +}