parent
c78862ef0e
commit
d1d06e192f
40
flake.nix
40
flake.nix
|
@ -139,24 +139,11 @@
|
||||||
inputs-1909 = inputs-2305 // { nixpkgs = inputs'.nixpkgs-1909; };
|
inputs-1909 = inputs-2305 // { nixpkgs = inputs'.nixpkgs-1909; };
|
||||||
inputs-test = inputs-edge // { nixpkgs = inputs'.nixpkgs-test; unstable = inputs'.nixpkgs-test; };
|
inputs-test = inputs-edge // { nixpkgs = inputs'.nixpkgs-test; unstable = inputs'.nixpkgs-test; };
|
||||||
|
|
||||||
mkFlakeView = inputs: system: inputs.nixpkgs.lib.mapAttrs (name: flake: flake // {
|
|
||||||
# TODO filter non-flake inputs
|
|
||||||
nixos = flake.nixosModules
|
|
||||||
or null;
|
|
||||||
pkgs = flake.packages.${system}
|
|
||||||
or flake.legacyPackages.${system}
|
|
||||||
or null;
|
|
||||||
lib = flake.lib.${system}
|
|
||||||
or flake.lib
|
|
||||||
or null;
|
|
||||||
}) inputs;
|
|
||||||
|
|
||||||
forSystems = systems: f: inputs-edge.nixpkgs.lib.genAttrs systems (system: f rec {
|
forSystems = systems: f: inputs-edge.nixpkgs.lib.genAttrs systems (system: f rec {
|
||||||
inherit system;
|
inherit system;
|
||||||
inputs = inputs-edge;
|
inputs = inputs-edge;
|
||||||
pkgs = inputs.nixpkgs.legacyPackages.${system};
|
pkgs = inputs.nixpkgs.legacyPackages.${system};
|
||||||
lib = inputs.nixpkgs.legacyPackages.${system}.lib;
|
lib = inputs.nixpkgs.legacyPackages.${system}.lib;
|
||||||
flakes = mkFlakeView inputs system;
|
|
||||||
});
|
});
|
||||||
forAllSystems = forSystems [
|
forAllSystems = forSystems [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
|
@ -185,7 +172,6 @@
|
||||||
home-manager.useGlobalPkgs = true; # go brrr, reuse overrides
|
home-manager.useGlobalPkgs = true; # go brrr, reuse overrides
|
||||||
home-manager.extraSpecialArgs = {
|
home-manager.extraSpecialArgs = {
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
flakes = mkFlakeView inputs system;
|
|
||||||
};
|
};
|
||||||
home-manager.sharedModules = [
|
home-manager.sharedModules = [
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
|
@ -215,7 +201,6 @@
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
flakes = mkFlakeView inputs system;
|
|
||||||
};
|
};
|
||||||
modules = [ (mkModule extra-modules domain system inputs stateVersion modules hostname) ];
|
modules = [ (mkModule extra-modules domain system inputs stateVersion modules hostname) ];
|
||||||
};
|
};
|
||||||
|
@ -297,24 +282,24 @@
|
||||||
inputs = inputs';
|
inputs = inputs';
|
||||||
|
|
||||||
lib = {
|
lib = {
|
||||||
inherit mkFlakeView forSystems;
|
# pass
|
||||||
} // forAllSystems ({ system, ... }: {
|
} // forAllSystems ({ system, ... }: {
|
||||||
inherit mkFlakeView forSystems;
|
# pass
|
||||||
flakes = mkFlakeView inputs-edge system;
|
|
||||||
flakes-2311 = mkFlakeView inputs-2311 system;
|
|
||||||
flakes-2305 = mkFlakeView inputs-2305 system;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
nixosModules = mkHosts (mkModule []);
|
nixosModules = mkHosts (mkModule []);
|
||||||
nixosConfigurations = mkHosts (mkConfig []);
|
nixosConfigurations = mkHosts (mkConfig []);
|
||||||
nixosReports = mkHosts (mkReport []);
|
nixosReports = mkHosts (mkReport []);
|
||||||
|
|
||||||
packages = forAllSystems ({ inputs, pkgs, lib, flakes, ... }: let
|
# TODO: overlays
|
||||||
|
|
||||||
|
packages = forAllSystems ({ inputs, pkgs, lib, ... }: let
|
||||||
|
# TODO: by-name
|
||||||
mk-nspawn-setup = hostname: # TODO: nspawn-tarball.nix populates /etc/nixos with junk
|
mk-nspawn-setup = hostname: # TODO: nspawn-tarball.nix populates /etc/nixos with junk
|
||||||
(pkgs.callPackage ./pkgs/mk-nspawn-setup {})
|
(pkgs.callPackage ./pkgs/mk-nspawn-setup {})
|
||||||
(mkHosts (mkConfig [ "${nixos-nspawn}/nspawn-tarball.nix" ])).${hostname};
|
(mkHosts (mkConfig [ "${nixos-nspawn}/nspawn-tarball.nix" ])).${hostname};
|
||||||
in {
|
in {
|
||||||
# TODO: get faketty to work ${expect}/bin/unbuffer is bad
|
# TODO: get faketty to work, ${expect}/bin/unbuffer is bad
|
||||||
nixos-rebuild-nom = pkgs.writeScriptBin "nixos-rebuild" ''
|
nixos-rebuild-nom = pkgs.writeScriptBin "nixos-rebuild" ''
|
||||||
if test -t 1 && test -z "''${NIX_NO_NOM-}"; then
|
if test -t 1 && test -z "''${NIX_NO_NOM-}"; then
|
||||||
exec ${lib.getExe pkgs.nixos-rebuild} -L "$@" |& ${lib.getExe pkgs.nix-output-monitor}
|
exec ${lib.getExe pkgs.nixos-rebuild} -L "$@" |& ${lib.getExe pkgs.nix-output-monitor}
|
||||||
|
@ -330,7 +315,7 @@
|
||||||
nspawn-setup-brumlebasse = mk-nspawn-setup "brumlebasse";
|
nspawn-setup-brumlebasse = mk-nspawn-setup "brumlebasse";
|
||||||
image-brumlebasse-openstack = nixos-generators-2311.nixosGenerate {
|
image-brumlebasse-openstack = nixos-generators-2311.nixosGenerate {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = { inherit inputs flakes; };
|
specialArgs = { inherit inputs; };
|
||||||
modules = [ (mkHosts (mkModule [])).brumlebasse ];
|
modules = [ (mkHosts (mkModule [])).brumlebasse ];
|
||||||
format = "openstack";
|
format = "openstack";
|
||||||
};
|
};
|
||||||
|
@ -352,7 +337,6 @@
|
||||||
}];
|
}];
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
flakes = mkFlakeView inputs system;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
@ -367,10 +351,10 @@
|
||||||
pbsds-gnome-2305 = mkHome "pbsds" "/home/pbsds" inputs-2305 [ ./users/pbsds/home/gnome.nix ];
|
pbsds-gnome-2305 = mkHome "pbsds" "/home/pbsds" inputs-2305 [ ./users/pbsds/home/gnome.nix ];
|
||||||
});
|
});
|
||||||
|
|
||||||
devShells = forAllSystems ({ pkgs, flakes, ... }: let
|
devShells = forAllSystems ({ pkgs, system, ... }: let
|
||||||
mkShell = packages: pkgs.mkShellNoCC { inherit packages; };
|
mkShell = packages: pkgs.mkShellNoCC { inherit packages; };
|
||||||
envrc-pkgs = [
|
envrc-pkgs = [
|
||||||
flakes.self.pkgs.nixos-rebuild-nom
|
self.packages.${system}.nixos-rebuild-nom
|
||||||
pkgs.home-manager
|
pkgs.home-manager
|
||||||
pkgs.nix-output-monitor
|
pkgs.nix-output-monitor
|
||||||
pkgs.cachix
|
pkgs.cachix
|
||||||
|
@ -384,12 +368,12 @@
|
||||||
in {
|
in {
|
||||||
envrc-local = mkShell envrc-pkgs;
|
envrc-local = mkShell envrc-pkgs;
|
||||||
envrc-remote = mkShell (envrc-pkgs ++ [
|
envrc-remote = mkShell (envrc-pkgs ++ [
|
||||||
(pkgs.remote-exec or flakes.unstable.pkgs.remote-exec)
|
pkgs.remote-exec
|
||||||
pkgs.yq
|
pkgs.yq
|
||||||
pkgs.rsync
|
pkgs.rsync
|
||||||
]);
|
]);
|
||||||
remoteenv = mkShell [
|
remoteenv = mkShell [
|
||||||
flakes.self.pkgs.nixos-rebuild-nom
|
self.packages.${system}.nixos-rebuild-nom
|
||||||
pkgs.age
|
pkgs.age
|
||||||
pkgs.ssh-to-age
|
pkgs.ssh-to-age
|
||||||
pkgs.just
|
pkgs.just
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, pkgs, lib, mkDomain, flakes, ... }:
|
{ config, pkgs, lib, mkDomain, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.docs-to-host;
|
cfg = config.services.docs-to-host;
|
||||||
|
@ -48,7 +48,7 @@ in
|
||||||
services.docs-to-host.enable = mkEnableOption (lib.mdDoc "docs-to-host");
|
services.docs-to-host.enable = mkEnableOption (lib.mdDoc "docs-to-host");
|
||||||
services.docs-to-host.pagefind = {
|
services.docs-to-host.pagefind = {
|
||||||
enable = mkEnableOption (lib.mdDoc "pagefind default on index of docs");
|
enable = mkEnableOption (lib.mdDoc "pagefind default on index of docs");
|
||||||
package = mkPackageOptionMD flakes.unstable.pkgs "pagefind" { };
|
package = mkPackageOptionMD pkgs.unstable "pagefind" { };
|
||||||
};
|
};
|
||||||
services.docs-to-host.docs = mkOption {
|
services.docs-to-host.docs = mkOption {
|
||||||
type = types.listOf (types.submodule {
|
type = types.listOf (types.submodule {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ config, lib, mkDomain, flakes, ... }:
|
{ config, lib, mkDomain, inputs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
myStickerPicker = flakes.maunium-stickerpicker-nix.createStickerPicker {
|
myStickerPicker = inputs.maunium-stickerpicker-nix.createStickerPicker {
|
||||||
#homeserver = "https://matrix.pvv.ntnu.no";
|
#homeserver = "https://matrix.pvv.ntnu.no";
|
||||||
#userId = "@stickerbot:my.matrix.server";
|
#userId = "@stickerbot:my.matrix.server";
|
||||||
## You should probably encrypt this with either agenix, sops-nix or whatever else
|
## You should probably encrypt this with either agenix, sops-nix or whatever else
|
||||||
|
|
Loading…
Reference in New Issue