2021-10-05 23:45:02 +02:00
|
|
|
{
|
|
|
|
description = "System config";
|
|
|
|
|
|
|
|
inputs = {
|
2021-11-12 17:10:17 +01:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
2021-10-05 23:45:02 +02:00
|
|
|
|
|
|
|
home-manager = {
|
|
|
|
url = "github:nix-community/home-manager";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2021-11-12 07:23:46 +01:00
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2021-10-05 23:45:02 +02:00
|
|
|
|
2021-11-21 19:07:12 +01:00
|
|
|
ha-now-playing = {
|
|
|
|
url = "git+ssh://git@git.datarift.nl/erwin/ha-now-playing.git?ref=main";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.utils.follows = "flake-utils";
|
|
|
|
};
|
2021-10-05 23:45:02 +02:00
|
|
|
|
2021-11-21 19:07:12 +01:00
|
|
|
pamedia = {
|
|
|
|
url = "git+ssh://git@git.datarift.nl/erwin/pamedia.git?ref=main";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.utils.follows = "flake-utils";
|
|
|
|
};
|
2021-11-12 07:23:46 +01:00
|
|
|
};
|
2021-10-05 23:45:02 +02:00
|
|
|
|
2021-11-21 19:07:12 +01:00
|
|
|
outputs = { self, ha-now-playing, pamedia, ... }@inputs:
|
2021-11-12 17:10:17 +01:00
|
|
|
with inputs;
|
2021-11-12 07:23:46 +01:00
|
|
|
let
|
2021-10-07 09:59:54 +02:00
|
|
|
|
2021-11-21 19:07:12 +01:00
|
|
|
defSystem = system: baseConfig:
|
2021-11-12 07:23:46 +01:00
|
|
|
nixpkgs.lib.nixosSystem {
|
2021-11-21 19:07:12 +01:00
|
|
|
system = "${system}";
|
2021-11-12 07:23:46 +01:00
|
|
|
modules = [
|
|
|
|
{ _module.args.inputs = inputs; }
|
|
|
|
{ _module.args.self-overlay = self.overlay; }
|
2021-11-21 19:07:12 +01:00
|
|
|
{ _module.args.pamedia-overlay = pamedia.overlay; }
|
|
|
|
{ _module.args.ha-now-playing-overlay = ha-now-playing.overlay; }
|
2021-11-12 07:23:46 +01:00
|
|
|
({ ... }: {
|
|
|
|
imports = builtins.attrValues self.nixosModules ++ [
|
|
|
|
{
|
|
|
|
nix.nixPath = [ "nixpkgs=${nixpkgs}" ];
|
2021-11-21 19:07:12 +01:00
|
|
|
nixpkgs.overlays = [
|
|
|
|
self.overlay
|
|
|
|
ha-now-playing.overlay
|
|
|
|
pamedia.overlay
|
|
|
|
];
|
2021-11-12 07:23:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
baseConfig
|
|
|
|
home-manager.nixosModules.home-manager
|
|
|
|
{ home-manager.useUserPackages = true; }
|
|
|
|
];
|
|
|
|
|
|
|
|
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
|
|
|
|
nix.registry.nixpkgs.flake = nixpkgs;
|
|
|
|
})
|
|
|
|
];
|
2021-10-05 23:45:02 +02:00
|
|
|
};
|
|
|
|
|
2021-10-18 21:45:28 +02:00
|
|
|
in
|
|
|
|
{
|
2021-11-21 19:07:12 +01:00
|
|
|
overlay = import ./overlays;
|
2021-11-12 17:10:17 +01:00
|
|
|
# overlay = final: prev: {
|
|
|
|
# unstable = import nixpkgs {
|
|
|
|
# system = "x86_64-linux";
|
|
|
|
# config.allowUnfree = true;
|
|
|
|
# };
|
|
|
|
# };
|
2021-10-05 23:45:02 +02:00
|
|
|
|
2021-11-12 07:23:46 +01:00
|
|
|
nixosModules = builtins.listToAttrs (map
|
|
|
|
(x: {
|
|
|
|
name = x;
|
|
|
|
value = import (./modules + "/${x}");
|
|
|
|
})
|
|
|
|
(builtins.attrNames (builtins.readDir ./modules)));
|
2021-10-05 23:45:02 +02:00
|
|
|
|
2021-11-12 07:23:46 +01:00
|
|
|
nixosConfigurations = {
|
2021-11-12 17:10:17 +01:00
|
|
|
vm1 = defSystem "x86_64-linux" {
|
|
|
|
imports = [
|
|
|
|
(import (./machines/vm1/configuration.nix) { inherit self; })
|
|
|
|
];
|
|
|
|
};
|
2021-11-12 07:23:46 +01:00
|
|
|
vm2 = defSystem "x86_64-linux" {
|
|
|
|
imports = [
|
|
|
|
(import (./machines/vm2/configuration.nix) { inherit self; })
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2021-11-21 19:07:12 +01:00
|
|
|
loki = defSystem "x86_64-linux" {
|
|
|
|
imports = [
|
|
|
|
(import (./machines/loki/configuration.nix) { inherit self; })
|
|
|
|
];
|
|
|
|
};
|
2021-11-12 07:23:46 +01:00
|
|
|
|
2021-10-05 23:45:02 +02:00
|
|
|
};
|
2021-11-12 17:10:17 +01:00
|
|
|
} //
|
2021-11-16 00:22:18 +01:00
|
|
|
(flake-utils.lib.eachSystem [ "aarch64-linux" "x86_64-linux" ])
|
2021-11-12 07:23:46 +01:00
|
|
|
(system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
2021-11-21 19:07:12 +01:00
|
|
|
overlays = [
|
|
|
|
self.overlay
|
|
|
|
ha-now-playing.overlay
|
|
|
|
pamedia.overlay
|
|
|
|
];
|
2021-11-12 07:23:46 +01:00
|
|
|
config = {
|
|
|
|
allowUnsupportedSystem = true;
|
|
|
|
allowUnfree = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
rec {
|
|
|
|
packages = flake-utils.lib.flattenTree {
|
|
|
|
rofi-wayland = pkgs.rofi-wayland;
|
2021-11-21 19:07:12 +01:00
|
|
|
# pamedia = pkgs.pamedia;
|
2021-11-12 07:23:46 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
apps = {
|
|
|
|
rofi-wayland = flake-utils.lib.mkApp { drv = packages.rofi-wayland; };
|
2021-11-21 19:07:12 +01:00
|
|
|
# pamedia = flake-utils.lib.mkApp { drv = packages.pamedia; };
|
2021-11-12 07:23:46 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
2021-10-05 23:45:02 +02:00
|
|
|
}
|