diff options
author | Mark Nipper <nipsy@bitgnome.net> | 2024-03-31 02:40:11 -0700 |
---|---|---|
committer | Mark Nipper <nipsy@bitgnome.net> | 2024-03-31 02:40:11 -0700 |
commit | 76b3b07e7329be637b37f92e767595143d3b03fa (patch) | |
tree | ff674a9bc8d8e1cdba94cb0d1c13de28b75c1e74 /flake.nix | |
parent | 04fd53819ffce3e1275ec48bcdf71769414fdea1 (diff) | |
download | nix-76b3b07e7329be637b37f92e767595143d3b03fa.tar nix-76b3b07e7329be637b37f92e767595143d3b03fa.tar.gz nix-76b3b07e7329be637b37f92e767595143d3b03fa.tar.bz2 nix-76b3b07e7329be637b37f92e767595143d3b03fa.tar.lz nix-76b3b07e7329be637b37f92e767595143d3b03fa.tar.xz nix-76b3b07e7329be637b37f92e767595143d3b03fa.tar.zst nix-76b3b07e7329be637b37f92e767595143d3b03fa.zip |
Migrate to more modular layout
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..719b19a --- /dev/null +++ b/flake.nix @@ -0,0 +1,70 @@ +{ + description = "nipsy's NixOS configuration"; + + inputs = { + hardware.url = "github:nixos/nixos-hardware"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixpkgs.url = "github:NixOS/nixpkgs/release-23.11"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ... } @ inputs: + let + inherit (self) outputs; + lib = nixpkgs.lib // home-manager.lib; + systems = [ + "x86_64-linux" + # "aarch64-linux" + # "x86_64-darwin" + #"aarch64-darwin" + # "i686-linux" + ]; + forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system}); + pkgsFor = lib.genAttrs systems (system: import nixpkgs { + inherit system; + config.allowUnfree = true; + }); + in + { + inherit lib; + + # Custom modules to enable special functionality for nixos or home-manager oriented configs. + nixosModules = import ./modules/nixos; + homeManagerModules = import ./modules/home-manager; + + # Custom modifications/overrides to upstream packages. + overlays = import ./overlays { inherit inputs outputs; }; + + # Your custom packages meant to be shared or upstreamed. + # Accessible through 'nix build', 'nix shell', etc + packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; }); + + # nixos-rebuild switch --flake .#hostname' + nixosConfigurations = { + ginaz = nixpkgs-unstable.lib.nixosSystem rec { + system = "x86_64-linux"; + modules = [ + { + nixpkgs.config.pkgs = import nixpkgs-unstable { inherit system; }; + } + ./hosts/ginaz + ]; + specialArgs = { inherit inputs outputs; }; + }; + }; + + # home-manager switch --flake .#primary-username@hostname' + homeConfigurations = { + "nipsy@ginaz" = lib.homeManagerConfiguration { + modules = [ ./home/nipsy/ginaz.nix ]; + pkgs = pkgsFor.x86_64-linux; + extraSpecialArgs = { inherit inputs outputs; }; + }; + }; + }; +} |