2021-10-05 23:45:02 +02:00
|
|
|
{
|
|
|
|
description = "System config";
|
|
|
|
|
|
|
|
inputs = {
|
2021-11-12 07:23:46 +01:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.05";
|
|
|
|
nixpkgs-unstable.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-12 07:23:46 +01:00
|
|
|
};
|
2021-10-05 23:45:02 +02:00
|
|
|
|
2021-11-12 07:23:46 +01:00
|
|
|
outputs = { nixpkgs, home-manager, ... }@inputs:
|
|
|
|
let
|
2021-10-07 09:59:54 +02:00
|
|
|
|
2021-11-12 07:23:46 +01:00
|
|
|
defSystem = systemArch: baseConfig:
|
|
|
|
nixpkgs.lib.nixosSystem {
|
|
|
|
system = "${systemArch}";
|
|
|
|
modules = [
|
|
|
|
{ _module.args.inputs = inputs; }
|
|
|
|
{ _module.args.self-overlay = self.overlay; }
|
|
|
|
{ _module.args.overlay-unstable = self.overlay-unstable; }
|
|
|
|
({ ... }: {
|
|
|
|
imports = builtins.attrValues self.nixosModules ++ [
|
|
|
|
{
|
|
|
|
nix.nixPath = [ "nixpkgs=${nixpkgs}" ];
|
|
|
|
nixpkgs.overlays = [ self.overlay self.overlay-unstable ];
|
|
|
|
}
|
|
|
|
|
|
|
|
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-11-12 07:23:46 +01:00
|
|
|
# nixosUsers = [{
|
|
|
|
# name = "erwin";
|
|
|
|
# groups = [ "wheel" "networkmanager" "video" ];
|
|
|
|
# uid = 1000;
|
|
|
|
# shell = pkgs.fish;
|
|
|
|
# openssh.authorizedKeys.keys = [
|
|
|
|
# "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMNoTcRsAxDwpiIj6nhUXwzSQjtcgKCR0RDlzP57wi0W erwin@horusvr-ws2"
|
|
|
|
# ];
|
|
|
|
# }];
|
2021-10-05 23:45:02 +02:00
|
|
|
|
2021-10-18 21:45:28 +02:00
|
|
|
in
|
|
|
|
{
|
2021-11-12 07:23:46 +01:00
|
|
|
# homeManagerConfigurations = {
|
|
|
|
# erwin = user.mkHMUser {
|
|
|
|
# userConfig = {
|
|
|
|
# git.enable = true;
|
|
|
|
# ssh.enable = true;
|
|
|
|
# applications.enable = true;
|
|
|
|
# gpg.enable = true;
|
|
|
|
# fish.enable = true;
|
|
|
|
# sway.enable = true;
|
|
|
|
# };
|
|
|
|
# username = "erwin";
|
|
|
|
# };
|
|
|
|
# };
|
|
|
|
|
|
|
|
overlay = final: prev: (import ./overlays) final prev;
|
|
|
|
overlay-unstable = final: prev: {
|
|
|
|
unstable = import nixpkgs-unstable {
|
|
|
|
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 = {
|
|
|
|
# vm1 = host.mkHost {
|
|
|
|
# name = "vm1";
|
|
|
|
# NICs = [ "enp1s0" ];
|
|
|
|
# kernelPackage = pkgs.linuxPackages;
|
|
|
|
# initrdMods = [ "ahci" "xhci_pci" "sr_mod" ];
|
|
|
|
# kernelMods = [ "kvm-amd" ];
|
|
|
|
# kernelParams = [ ];
|
|
|
|
# systemConfig = vm1UefiConfig;
|
2021-10-05 23:45:02 +02:00
|
|
|
|
2021-11-12 07:23:46 +01:00
|
|
|
# users = nixosUsers;
|
2021-10-05 23:45:02 +02:00
|
|
|
|
2021-11-12 07:23:46 +01:00
|
|
|
# cpuCores = 6;
|
|
|
|
# };
|
2021-10-05 23:45:02 +02:00
|
|
|
|
2021-11-12 07:23:46 +01:00
|
|
|
# vm2 = host.mkHost {
|
|
|
|
# name = "vm2";
|
|
|
|
# NICs = [ "enp1s0" ];
|
2021-10-07 09:59:54 +02:00
|
|
|
# kernelPackage = pkgs.linuxPackages;
|
2021-11-12 07:23:46 +01:00
|
|
|
# initrdMods = [ "ahci" "xhci_pci" "sr_mod" ];
|
2021-10-07 09:59:54 +02:00
|
|
|
# kernelMods = [ "kvm-amd" ];
|
2021-11-12 07:23:46 +01:00
|
|
|
# kernelParams = [ ];
|
|
|
|
# systemConfig = vm2Config;
|
|
|
|
|
|
|
|
# users = nixosUsers;
|
|
|
|
|
|
|
|
# cpuCores = 4;
|
2021-10-07 09:59:54 +02:00
|
|
|
# };
|
2021-11-12 07:23:46 +01:00
|
|
|
vm2 = defSystem "x86_64-linux" {
|
|
|
|
imports = [
|
|
|
|
(import (./machines/vm2/configuration.nix) { inherit self; })
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
# loki = defSystem "x86_64-linux" {
|
|
|
|
# imports = [
|
|
|
|
# (import (./machines/loki/configuration.nix) { inherit self; })
|
|
|
|
# ];
|
|
|
|
# };
|
|
|
|
|
2021-10-05 23:45:02 +02:00
|
|
|
};
|
2021-11-12 07:23:46 +01:00
|
|
|
}
|
|
|
|
(flake-utils.lib.eachSystem [ "x86_64-linux" ])
|
|
|
|
(system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [ self.overlay ];
|
|
|
|
config = {
|
|
|
|
allowUnsupportedSystem = true;
|
|
|
|
allowUnfree = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
rec {
|
|
|
|
packages = flake-utils.lib.flattenTree {
|
|
|
|
rofi-wayland = pkgs.rofi-wayland;
|
|
|
|
};
|
|
|
|
|
|
|
|
apps = {
|
|
|
|
rofi-wayland = flake-utils.lib.mkApp { drv = packages.rofi-wayland; };
|
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
2021-10-05 23:45:02 +02:00
|
|
|
}
|