This commit is contained in:
Peder Bergebakken Sundt 2023-06-20 01:36:49 +02:00
parent 850a188f4b
commit 1405e7f020
1 changed files with 12 additions and 14 deletions

View File

@ -47,7 +47,12 @@
"aarch64-linux" "aarch64-linux"
#"riscv64-linux" #"riscv64-linux"
]; ];
forAllSystems = f: nixlib.genAttrs systems (system: f system); #forAllSystems = f: nixlib.genAttrs systems (system: f system);
forAllSystems = f: nixlib.genAttrs systems (system: f {
inherit system;
pkgs = nixpkgs.legacyPackages.${system};
lib = nixpkgs.legacyPackages.${system}.lib;
});
overlays = nixlib.mapAttrsToList (name: val: val) self.overlays; overlays = nixlib.mapAttrsToList (name: val: val) self.overlays;
# TODO: move unstable and nur here? # TODO: move unstable and nur here?
@ -90,13 +95,8 @@
inherit inputs; inherit inputs;
overlays.remote-exec = (final: prev: { packages = forAllSystems({ pkgs, ... }: {
remote-exec = prev.python3Packages.callPackage "${inputs.pr-remote-exec}/pkgs/tools/misc/remote-exec" {}; remote-exec = pkgs.python3Packages.callPackage "${inputs.pr-remote-exec}/pkgs/tools/misc/remote-exec" {};
});
packages = forAllSystems(system:
let pkgs = nixpkgs.legacyPackages.${system}; in {
inherit (self.overlays.remote-exec null pkgs) remote-exec;
}); });
nixosConfigurations = let nm = nixos-hardware.nixosModules; in { nixosConfigurations = let nm = nixos-hardware.nixosModules; in {
@ -107,19 +107,17 @@
sopp = mkConfig "sopp" "x86_64-linux" (with nm; [ common-pc common-pc-ssd common-cpu-intel common-gpu-nvidia-nonprime ]); sopp = mkConfig "sopp" "x86_64-linux" (with nm; [ common-pc common-pc-ssd common-cpu-intel common-gpu-nvidia-nonprime ]);
}; };
homeConfigurations = forAllSystems (system: let homeConfigurations = forAllSystems ({ pkgs, ... }: let
mkHome = modules: home-manager.lib.homeManagerConfiguration { mkHome = modules: home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system}; inherit pkgs modules;
inherit modules;
}; };
in { in {
pbsds = mkHome [ ./users/pbsds/home ]; pbsds = mkHome [ ./users/pbsds/home ];
pbsds-gnome = mkHome [ ./users/pbsds/home/gnome.nix ]; pbsds-gnome = mkHome [ ./users/pbsds/home/gnome.nix ];
}); });
devShells = forAllSystems (system: let devShells = forAllSystems ({ system, pkgs, ... }: let
pkgs = nixpkgs.legacyPackages.${system}; inherit (self.packages.${system}) remote-exec;
remote-exec = pkgs.remote-exec or (self.overlays.remote-exec pkgs pkgs).remote-exec;
nixos-rebuild-nom = pkgs.writeScriptBin "nixos-rebuild" '' nixos-rebuild-nom = pkgs.writeScriptBin "nixos-rebuild" ''
exec ${pkgs.nixos-rebuild}/bin/nixos-rebuild "$@" |& ${pkgs.nix-output-monitor}/bin/nom exec ${pkgs.nixos-rebuild}/bin/nixos-rebuild "$@" |& ${pkgs.nix-output-monitor}/bin/nom
''; '';