Rename nixpkgs input to nixos
This commit is contained in:
parent
9eef50b0f0
commit
a48b72c4a3
65
flake.nix
65
flake.nix
|
@ -2,7 +2,7 @@
|
|||
description = "C3D2 NixOS configurations";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";
|
||||
nixos.url = "github:nixos/nixpkgs/nixos-22.05";
|
||||
nixpkgs-mobilizon.url = "github:minijackson/nixpkgs/init-mobilizon";
|
||||
nixos-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
# contains portunus WIP branch on current nixos-unstable
|
||||
|
@ -10,13 +10,13 @@
|
|||
nixos-hardware.url = "github:nixos/nixos-hardware";
|
||||
fenix = {
|
||||
url = "github:nix-community/fenix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.nixpkgs.follows = "nixos";
|
||||
};
|
||||
heliwatch = {
|
||||
url = "git+https://gitea.c3d2.de/astro/heliwatch.git";
|
||||
inputs = {
|
||||
fenix.follows = "fenix";
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
nixpkgs.follows = "nixos";
|
||||
naersk.follows = "naersk";
|
||||
};
|
||||
};
|
||||
|
@ -24,11 +24,11 @@
|
|||
hydra-ca.url = "github:mlabs-haskell/hydra/aciceri/ca-derivations";
|
||||
microvm = {
|
||||
url = "github:astro/microvm.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.nixpkgs.follows = "nixos";
|
||||
};
|
||||
naersk = {
|
||||
url = "github:nix-community/naersk";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.nixpkgs.follows = "nixos";
|
||||
};
|
||||
oparl-scraper = {
|
||||
url = "github:offenesdresden/ratsinfo-scraper/oparl";
|
||||
|
@ -41,7 +41,7 @@
|
|||
openwrt-imagebuilder = {
|
||||
url = "github:astro/nix-openwrt-imagebuilder";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
nixpkgs.follows = "nixos";
|
||||
openwrt.follows = "openwrt";
|
||||
};
|
||||
};
|
||||
|
@ -52,15 +52,15 @@
|
|||
secrets = {
|
||||
url = "git+ssh://gitea@gitea.c3d2.de/c3d2-admins/secrets.git";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
nixpkgs.follows = "nixos";
|
||||
sops-nix.follows = "sops-nix";
|
||||
};
|
||||
};
|
||||
sops-nix = {
|
||||
url = "github:Mic92/sops-nix";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
nixpkgs-22_05.follows = "nixpkgs";
|
||||
nixpkgs.follows = "nixos";
|
||||
nixpkgs-22_05.follows = "nixos";
|
||||
};
|
||||
};
|
||||
spacemsg = {
|
||||
|
@ -72,7 +72,7 @@
|
|||
inputs = {
|
||||
fenix.follows = "fenix";
|
||||
naersk.follows = "naersk";
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
nixpkgs.follows = "nixos";
|
||||
};
|
||||
};
|
||||
tigger = {
|
||||
|
@ -81,26 +81,26 @@
|
|||
};
|
||||
yammat = {
|
||||
url = "git+https://gitea.c3d2.de/C3D2/yammat.git?ref=nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.nixpkgs.follows = "nixos";
|
||||
};
|
||||
zentralwerk = {
|
||||
url = "git+https://gitea.c3d2.de/zentralwerk/network.git";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
nixpkgs-master.follows = "nixpkgs";
|
||||
nixpkgs.follows = "nixos";
|
||||
nixpkgs-master.follows = "nixos";
|
||||
openwrt.follows = "openwrt";
|
||||
openwrt-imagebuilder.follows = "openwrt-imagebuilder";
|
||||
};
|
||||
};
|
||||
riscv64 = {
|
||||
url = "github:zhaofengli/nixos-riscv64";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.nixpkgs.follows = "nixos";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, nixos-unstable, nixpkgs, secrets, nixos-hardware, zentralwerk, yammat, scrapers, spacemsg, tigger, ticker, heliwatch, sops-nix, naersk, fenix, microvm, riscv64, oparl-scraper, ... }:
|
||||
outputs = inputs@{ self, nixos-unstable, nixos, secrets, nixos-hardware, zentralwerk, yammat, scrapers, spacemsg, tigger, ticker, heliwatch, sops-nix, naersk, fenix, microvm, riscv64, oparl-scraper, ... }:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
inherit (nixos) lib;
|
||||
forAllSystems = lib.genAttrs [ "aarch64-linux" "x86_64-linux" ];
|
||||
|
||||
# all the input flakes for `nix copy` to the build machine,
|
||||
|
@ -149,7 +149,7 @@
|
|||
legacyPackages = lib.attrsets.mapAttrs
|
||||
(system: pkgs: pkgs.appendOverlays
|
||||
[ fenix.overlay naersk.overlay self.overlay ])
|
||||
nixpkgs.legacyPackages;
|
||||
nixos.legacyPackages;
|
||||
|
||||
packages = lib.attrsets.mapAttrs (system: pkgs:
|
||||
let overlayPkgs = builtins.intersectAttrs (self.overlay {} {}) pkgs;
|
||||
|
@ -167,7 +167,7 @@
|
|||
${pkgs.lib.concatMapStringsSep "\n" (name:
|
||||
let
|
||||
addr = getHostAddr name;
|
||||
in nixpkgs.lib.optionalString (addr != null) ''
|
||||
in nixos.lib.optionalString (addr != null) ''
|
||||
echo -n -e "${name}: $RED"
|
||||
RUNNING=$(ssh -o PreferredAuthentications=publickey -o StrictHostKeyChecking=accept-new root@"${addr}" "readlink /run/current-system")
|
||||
if [ $? = 0 ] && [ -n "$RUNNING" ]; then
|
||||
|
@ -225,7 +225,7 @@
|
|||
#!${pkgs.runtimeShell}
|
||||
exec ${pkgs.wol}/bin/wol ${hostRegistry.hosts."${host}".ether}
|
||||
'';
|
||||
}) {} (builtins.attrNames (nixpkgs.lib.filterAttrs (_: { wol ? false, ... }: wol) hostRegistry.hosts)) //
|
||||
}) {} (builtins.attrNames (nixos.lib.filterAttrs (_: { wol ? false, ... }: wol) hostRegistry.hosts)) //
|
||||
|
||||
builtins.foldl' (result: name:
|
||||
let
|
||||
|
@ -369,7 +369,7 @@
|
|||
inherit (self.nixosConfigurations.${host}) config;
|
||||
in
|
||||
result //
|
||||
nixpkgs.lib.optionalAttrs (config.system.build ? vm) {
|
||||
nixos.lib.optionalAttrs (config.system.build ? vm) {
|
||||
# boot any machine in a microvm
|
||||
"${host}-vm" = (self.nixosConfigurations.${host}
|
||||
.extendModules {
|
||||
|
@ -377,9 +377,9 @@
|
|||
microvm.nixosModules.microvm
|
||||
{
|
||||
microvm = {
|
||||
mem = nixpkgs.lib.mkForce 2048;
|
||||
hypervisor = nixpkgs.lib.mkForce "qemu";
|
||||
socket = nixpkgs.lib.mkForce null;
|
||||
mem = nixos.lib.mkForce 2048;
|
||||
hypervisor = nixos.lib.mkForce "qemu";
|
||||
socket = nixos.lib.mkForce null;
|
||||
shares = [ {
|
||||
tag = "ro-store";
|
||||
source = "/nix/store";
|
||||
|
@ -398,7 +398,7 @@
|
|||
})
|
||||
.config.microvm.declaredRunner;
|
||||
} //
|
||||
nixpkgs.lib.optionalAttrs (config.system.build ? tftproot) {
|
||||
nixos.lib.optionalAttrs (config.system.build ? tftproot) {
|
||||
"${host}-tftproot" = config.system.build.tftproot;
|
||||
}
|
||||
) {} (builtins.attrNames self.nixosConfigurations)
|
||||
|
@ -407,7 +407,7 @@
|
|||
nixosConfigurations = let
|
||||
nixosSystem' =
|
||||
# Our custom NixOS builder
|
||||
{ nixpkgs ? inputs.nixpkgs, modules, extraArgs ? {}, specialArgs ? { }, system ? "x86_64-linux" }:
|
||||
{ nixpkgs ? inputs.nixos, modules, extraArgs ? {}, specialArgs ? { }, system ? "x86_64-linux" }:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit specialArgs system;
|
||||
|
||||
|
@ -535,7 +535,7 @@
|
|||
|
||||
rpi-netboot = nixosSystem' {
|
||||
modules = [
|
||||
{ _module.args = { inherit nixpkgs; }; }
|
||||
{ _module.args = { inherit nixos; }; }
|
||||
nixos-hardware.nixosModules.raspberry-pi-4
|
||||
self.nixosModules.rpi-netboot
|
||||
./hosts/rpi-netboot
|
||||
|
@ -668,7 +668,7 @@
|
|||
|
||||
c3d2-web = nixosSystem' {
|
||||
modules = [
|
||||
{ _module.args = { inherit nixpkgs; }; }
|
||||
{ _module.args = { inherit nixos; }; }
|
||||
self.nixosModules.microvm
|
||||
./hosts/containers/c3d2-web
|
||||
{ nixpkgs.overlays = [ secrets.overlays.c3d2-web ]; }
|
||||
|
@ -676,13 +676,13 @@
|
|||
};
|
||||
|
||||
sdrweb = nixosSystem' {
|
||||
nixpkgs = nixos-unstable;
|
||||
modules = [
|
||||
self.nixosModules.microvm
|
||||
{ nixpkgs.overlays = [ secrets.overlays.mucbot ]; }
|
||||
heliwatch.nixosModules.heliwatch
|
||||
./hosts/containers/sdrweb
|
||||
];
|
||||
nixpkgs = nixos-unstable;
|
||||
};
|
||||
|
||||
bind = nixosSystem' {
|
||||
|
@ -753,7 +753,7 @@
|
|||
self.nixosModules.microvm
|
||||
./hosts/containers/nfsroot
|
||||
{
|
||||
_module.args.tftproots = nixpkgs.lib.filterAttrs (name: _:
|
||||
_module.args.tftproots = nixos.lib.filterAttrs (name: _:
|
||||
builtins.match ".+-tftproot" name != null
|
||||
) self.packages.x86_64-linux;
|
||||
} ];
|
||||
|
@ -785,13 +785,12 @@
|
|||
};
|
||||
|
||||
gnunet = nixosSystem' {
|
||||
nixpkgs = nixos-unstable;
|
||||
modules = [
|
||||
self.nixosModules.microvm
|
||||
./hosts/containers/gnunet
|
||||
];
|
||||
nixpkgs = nixos-unstable;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
nixosModule = self.nixosModules.c3d2;
|
||||
|
@ -822,14 +821,14 @@
|
|||
};
|
||||
|
||||
hydraJobs =
|
||||
builtins.mapAttrs (_: nixpkgs.lib.hydraJob) (
|
||||
builtins.mapAttrs (_: nixos.lib.hydraJob) (
|
||||
builtins.mapAttrs (_: nixosSystem:
|
||||
if nixosSystem.config ? microvm.declaredRunner
|
||||
then nixosSystem.config.microvm.declaredRunner
|
||||
else nixosSystem.config.system.build.toplevel
|
||||
) self.nixosConfigurations
|
||||
//
|
||||
nixpkgs.lib.filterAttrs (name: _:
|
||||
nixos.lib.filterAttrs (name: _:
|
||||
builtins.match ".+-tftproot" name != null
|
||||
) self.packages.aarch64-linux
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue