Upgrade to 22.05 (and much else)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
description = "Fudo Host Configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-21.05";
|
||||
nixpkgs.url = "nixpkgs/nixos-22.05";
|
||||
|
||||
fudo-home = {
|
||||
url = "git+https://git.fudo.org/fudo-nix/home.git";
|
||||
@@ -30,140 +30,122 @@
|
||||
chuteUnstable.url = "git+https://git.fudo.org/chute/chute.git?ref=master";
|
||||
|
||||
nixpkgsUnstable.url = "nixpkgs/nixos-unstable";
|
||||
|
||||
# zigbee2mqtt-converters.url = "path:/net/projects/niten/zigbee2mqtt-converters";
|
||||
};
|
||||
|
||||
outputs = { self,
|
||||
nixpkgs,
|
||||
fudo-home,
|
||||
fudo-lib,
|
||||
fudo-entities,
|
||||
fudo-pkgs,
|
||||
fudo-secrets,
|
||||
chute,
|
||||
chuteUnstable,
|
||||
nixpkgsUnstable,
|
||||
... } @ inputs:
|
||||
outputs = { self, nixpkgs, fudo-home, fudo-lib, fudo-entities, fudo-pkgs
|
||||
, fudo-secrets, chute, chuteUnstable, nixpkgsUnstable,
|
||||
# zigbee2mqtt-converters,
|
||||
... }@inputs:
|
||||
with nixpkgs.lib;
|
||||
let
|
||||
fudo-nixos-hosts = filterAttrs
|
||||
(hostname: hostOpts: hostOpts.nixos-system)
|
||||
(fudo-entities.entities.hosts);
|
||||
fudo-nixos-hosts = filterAttrs (hostname: hostOpts: hostOpts.nixos-system)
|
||||
fudo-entities.entities.hosts;
|
||||
|
||||
fudo-networks = fudo-entities.entities.networks;
|
||||
|
||||
unstable-for = arch: import nixpkgsUnstable {
|
||||
system = arch;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
permittedInsecurePackages = [
|
||||
"openssh-with-gssapi-8.4p1"
|
||||
unstable-for = arch:
|
||||
import nixpkgsUnstable {
|
||||
system = arch;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
permittedInsecurePackages = [ "openssh-with-gssapi-8.4p1" ];
|
||||
};
|
||||
};
|
||||
|
||||
pkgs-for = arch:
|
||||
let unstable = unstable-for arch;
|
||||
in import nixpkgs {
|
||||
system = arch;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
permittedInsecurePackages = [ "openssh-with-gssapi-8.4p1" ];
|
||||
};
|
||||
overlays = [
|
||||
fudo-lib.overlay
|
||||
fudo-pkgs.overlay
|
||||
(final: prev: {
|
||||
chute = chute.packages.${arch}.chute;
|
||||
chuteUnstable = chuteUnstable.packages.${arch}.chute;
|
||||
})
|
||||
(final: prev: { pkgsUnstable = unstable; })
|
||||
(final: prev: { nyxt = unstable.nyxt; })
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
pkgs-for = arch: let
|
||||
unstable = unstable-for arch;
|
||||
in import nixpkgs {
|
||||
system = arch;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
permittedInsecurePackages = [
|
||||
"openssh-with-gssapi-8.4p1"
|
||||
latest-modified-timestamp = head (sort (a: b: a > b)
|
||||
(map (input: toInt input.lastModifiedDate)
|
||||
(filter (input: hasAttr "lastModifiedDate" input)
|
||||
(attrValues inputs))));
|
||||
|
||||
concat-timestamp = timestamp: toInt (substring 0 10 (toString timestamp));
|
||||
|
||||
common-host-config = hostname: hostOpts:
|
||||
let
|
||||
config-dir = ./config;
|
||||
build-timestamp = concat-timestamp latest-modified-timestamp;
|
||||
in { config, ... }: {
|
||||
imports = [
|
||||
fudo-home.nixosModule
|
||||
fudo-secrets.nixosModule
|
||||
fudo-lib.nixosModule
|
||||
fudo-entities.nixosModule
|
||||
|
||||
# zigbee2mqtt-converters.nixosModule
|
||||
|
||||
./config
|
||||
(config-dir + "/hardware/${hostname}.nix")
|
||||
(config-dir + "/host-config/${hostname}.nix")
|
||||
(config-dir + "/profile-config/${hostOpts.profile}.nix")
|
||||
(config-dir + "/domain-config/${hostOpts.domain}.nix")
|
||||
(config-dir + "/site-config/${hostOpts.site}.nix")
|
||||
];
|
||||
};
|
||||
overlays = [
|
||||
fudo-lib.overlay
|
||||
fudo-pkgs.overlay
|
||||
(final: prev: {
|
||||
chute = chute.packages.${arch}.chute;
|
||||
chuteUnstable = chuteUnstable.packages.${arch}.chute;
|
||||
})
|
||||
(final: prev: {
|
||||
nyxt = unstable.nyxt;
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
latest-modified-timestamp = head
|
||||
(sort (a: b: a > b)
|
||||
(map (input: toInt input.lastModifiedDate)
|
||||
(filter (input: hasAttr "lastModifiedDate" input)
|
||||
(attrValues inputs))));
|
||||
|
||||
concat-timestamp = timestamp:
|
||||
toInt (substring 0 10 (toString timestamp));
|
||||
|
||||
common-host-config = hostname: hostOpts: let
|
||||
config-dir = ./config;
|
||||
build-timestamp =
|
||||
concat-timestamp latest-modified-timestamp;
|
||||
in { config, ... }: {
|
||||
imports = [
|
||||
fudo-home.nixosModule
|
||||
fudo-secrets.nixosModule
|
||||
fudo-lib.nixosModule
|
||||
fudo-entities.nixosModule
|
||||
|
||||
./config
|
||||
(config-dir + /hardware/${hostname}.nix)
|
||||
(config-dir + /host-config/${hostname}.nix)
|
||||
(config-dir + /profile-config/${hostOpts.profile}.nix)
|
||||
(config-dir + /domain-config/${hostOpts.domain}.nix)
|
||||
(config-dir + /site-config/${hostOpts.site}.nix)
|
||||
];
|
||||
|
||||
config = let
|
||||
pkgs = pkgs-for hostOpts.arch;
|
||||
in {
|
||||
instance = let
|
||||
build-seed = builtins.readFile
|
||||
config.fudo.secrets.files.build-seed;
|
||||
config = let pkgs = pkgs-for hostOpts.arch;
|
||||
in {
|
||||
inherit hostname build-timestamp build-seed;
|
||||
};
|
||||
instance = let
|
||||
build-seed =
|
||||
builtins.readFile config.fudo.secrets.files.build-seed;
|
||||
in { inherit hostname build-timestamp build-seed; };
|
||||
|
||||
environment.etc.nixos-live.source = ./.;
|
||||
environment.etc.nixos-live.source = ./.;
|
||||
|
||||
nix = {
|
||||
registry = {
|
||||
nixpkgs.flake = nixpkgs;
|
||||
fudo-nixos.flake = self;
|
||||
fudo-entities.flake = fudo-entities;
|
||||
fudo-lib.flake = fudo-lib;
|
||||
fudo-pkgs.flake = fudo-pkgs;
|
||||
nix = {
|
||||
registry = {
|
||||
nixpkgs.flake = nixpkgs;
|
||||
fudo-nixos.flake = self;
|
||||
fudo-entities.flake = fudo-entities;
|
||||
fudo-lib.flake = fudo-lib;
|
||||
fudo-pkgs.flake = fudo-pkgs;
|
||||
};
|
||||
nixPath = let lib = nixpkgs.lib;
|
||||
in lib.mkDefault (lib.mkBefore [ "nixpkgs=${nixpkgs}" ]);
|
||||
};
|
||||
nixPath = let
|
||||
lib = nixpkgs.lib;
|
||||
in lib.mkDefault (lib.mkBefore [
|
||||
"nixpkgs=${nixpkgs}"
|
||||
]);
|
||||
|
||||
nixpkgs.pkgs = pkgs;
|
||||
};
|
||||
|
||||
nixpkgs.pkgs = pkgs;
|
||||
};
|
||||
};
|
||||
|
||||
nixos-host-config = hostname: hostOpts: let
|
||||
system = hostOpts.arch;
|
||||
in nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
(common-host-config hostname hostOpts)
|
||||
];
|
||||
};
|
||||
nixos-host-config = hostname: hostOpts:
|
||||
let system = hostOpts.arch;
|
||||
in nixosSystem {
|
||||
inherit system;
|
||||
modules = [ (common-host-config hostname hostOpts) ];
|
||||
};
|
||||
|
||||
nixops-host-config = hostname: hostOpts: let
|
||||
zone-hosts = fudo-entities.entities.zones.${hostOpts.domain}.hosts;
|
||||
in {
|
||||
imports = [
|
||||
(common-host-config hostname hostOpts)
|
||||
nixops-host-config = hostname: hostOpts:
|
||||
let zone-hosts = fudo-entities.entities.zones.${hostOpts.domain}.hosts;
|
||||
in {
|
||||
imports = [
|
||||
(common-host-config hostname hostOpts)
|
||||
|
||||
({ ... }: {
|
||||
config.deployment.targetHost =
|
||||
zone-hosts.${hostname}.ipv4-address;
|
||||
})
|
||||
];
|
||||
};
|
||||
(_: {
|
||||
config.deployment.targetHost =
|
||||
zone-hosts.${hostname}.ipv4-address;
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
in {
|
||||
nixosConfigurations = mapAttrs nixos-host-config fudo-nixos-hosts;
|
||||
|
||||
Reference in New Issue
Block a user