diff options
author | Mark Nipper <nipsy@bitgnome.net> | 2024-10-23 02:04:51 -0700 |
---|---|---|
committer | Mark Nipper <nipsy@bitgnome.net> | 2024-10-23 02:04:51 -0700 |
commit | f95e8c631c1f45249b716c5cf106c891be7d6c24 (patch) | |
tree | 7f3774068918b504cd19bfe1a860a5f1245e520d | |
parent | f03eaf57c08a9ee942e84666663458d7b437a408 (diff) | |
download | nix-f95e8c631c1f45249b716c5cf106c891be7d6c24.tar nix-f95e8c631c1f45249b716c5cf106c891be7d6c24.tar.gz nix-f95e8c631c1f45249b716c5cf106c891be7d6c24.tar.bz2 nix-f95e8c631c1f45249b716c5cf106c891be7d6c24.tar.lz nix-f95e8c631c1f45249b716c5cf106c891be7d6c24.tar.xz nix-f95e8c631c1f45249b716c5cf106c891be7d6c24.tar.zst nix-f95e8c631c1f45249b716c5cf106c891be7d6c24.zip |
Migrate to more standard flake template
-rw-r--r-- | flake.nix | 101 | ||||
-rw-r--r-- | hosts/arrakis/hardware-configuration.nix | 13 | ||||
-rw-r--r-- | hosts/common/optional/ebooks.nix | 8 | ||||
-rw-r--r-- | overlays/default.nix | 23 |
4 files changed, 60 insertions, 85 deletions
@@ -1,5 +1,5 @@ { - description = "nipsy's NixOS configuration"; + description = "nipsy's NixOS configurations"; inputs = { @@ -35,26 +35,22 @@ }; - outputs = inputs@{ home-manager-stable, home-manager, nixos-hardware, nixpkgs-stable, nixpkgs, nvidia-patch, sops-nix, ... }: { + outputs = { home-manager-stable, home-manager, nixos-hardware, nixpkgs-stable, nixpkgs, nvidia-patch, self, sops-nix, ... } @ inputs: let + inherit (self) outputs; + systems = [ + #"aarch64-linux" + #"i686-linux" + "x86_64-linux" + #"aarch64-darwin" + #"x86_64-darwin" + ]; + forAllSystems = nixpkgs.lib.genAttrs systems; + in { nixosConfigurations = { - arrakis = nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - - specialArgs = { inherit inputs nvidia-patch; - pkgs = import nixpkgs { - inherit system; - config.allowUnfree = true; - overlays = [(import ./pkgs)]; - }; - - pkgs-stable = import nixpkgs-stable { - inherit system; - config.allowUnfree = true; - }; - }; - + arrakis = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs outputs; }; modules = [ ./hosts/arrakis home-manager.nixosModules.home-manager { @@ -66,22 +62,8 @@ ]; }; - darkstar = nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - - specialArgs = { - pkgs = import nixpkgs { - inherit system; - config.allowUnfree = true; - overlays = [(import ./pkgs)]; - }; - - pkgs-stable = import nixpkgs-stable { - inherit system; - config.allowUnfree = true; - }; - }; - + darkstar = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs outputs; }; modules = [ ./hosts/darkstar home-manager.nixosModules.home-manager { @@ -93,21 +75,7 @@ }; ginaz = nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - - specialArgs = { - pkgs = import nixpkgs { - inherit system; - config.allowUnfree = true; - overlays = [(import ./pkgs)]; - }; - - pkgs-stable = import nixpkgs-stable { - inherit system; - config.allowUnfree = true; - }; - }; - + specialArgs = { inherit inputs outputs; }; modules = [ ./hosts/ginaz home-manager.nixosModules.home-manager { @@ -121,21 +89,7 @@ }; kaitain = nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - - specialArgs = { - pkgs = import nixpkgs { - inherit system; - config.allowUnfree = true; - overlays = [(import ./pkgs)]; - }; - - pkgs-stable = import nixpkgs-stable { - inherit system; - config.allowUnfree = true; - }; - }; - + specialArgs = { inherit inputs outputs; }; modules = [ ./hosts/kaitain home-manager.nixosModules.home-manager { @@ -146,21 +100,7 @@ }; richese = nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - - specialArgs = { - pkgs = import nixpkgs { - inherit system; - config.allowUnfree = true; - overlays = [(import ./pkgs)]; - }; - - pkgs-stable = import nixpkgs-stable { - inherit system; - config.allowUnfree = true; - }; - }; - + specialArgs = { inherit inputs outputs; }; modules = [ ./hosts/richese home-manager.nixosModules.home-manager { @@ -172,6 +112,9 @@ }; + overlays = import ./overlays {inherit inputs;}; + packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); + }; } diff --git a/hosts/arrakis/hardware-configuration.nix b/hosts/arrakis/hardware-configuration.nix index 92cbe02..6dc6542 100644 --- a/hosts/arrakis/hardware-configuration.nix +++ b/hosts/arrakis/hardware-configuration.nix @@ -1,7 +1,7 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, inputs, lib, pkgs, modulesPath, ... }: +{ config, inputs, lib, outputs, pkgs, modulesPath, ... }: { imports = @@ -88,7 +88,16 @@ { device = "/dev/disk/by-label/swap2"; } ]; - nixpkgs.overlays = [ inputs.nvidia-patch.overlays.default ]; + nixpkgs = { + config.allowUnfree = true; + hostPlatform = "x86_64-linux"; + overlays = [ + inputs.nvidia-patch.overlays.default + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.stable-packages + ]; + }; hardware = { bluetooth.enable = true; diff --git a/hosts/common/optional/ebooks.nix b/hosts/common/optional/ebooks.nix index 23706a2..7eba96c 100644 --- a/hosts/common/optional/ebooks.nix +++ b/hosts/common/optional/ebooks.nix @@ -1,8 +1,8 @@ -{ pkgs, pkgs-stable, ... }: +{ pkgs, ... }: { - environment.systemPackages = [ - pkgs.libgourou - pkgs-stable.calibre + environment.systemPackages = with pkgs; [ + libgourou + stable.calibre ]; services.udisks2.enable = true; diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..c39804a --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,23 @@ +# This file defines overlays +{inputs, ...}: { + # This one brings our custom packages from the 'pkgs' directory + additions = final: _prev: import ../pkgs final.pkgs; + + # This one contains whatever you want to overlay + # You can change versions, add patches, set compilation flags, anything really. + # https://nixos.wiki/wiki/Overlays + modifications = final: prev: { + # example = prev.example.overrideAttrs (oldAttrs: rec { + # ... + # }); + }; + + # When applied, the stable nixpkgs set (declared in the flake inputs) will + # be accessible through 'pkgs.stable' + stable-packages = final: _prev: { + stable = import inputs.nixpkgs-stable { + system = final.system; + config.allowUnfree = true; + }; + }; +} |