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
|
|
|
|
2022-10-05 11:32:13 +02:00
|
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
2022-07-02 19:09:47 +02:00
|
|
|
|
2022-11-19 20:00:54 +01:00
|
|
|
pre-commit-hooks = {
|
|
|
|
url = "github:cachix/pre-commit-hooks.nix";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2022-12-06 13:44:15 +01:00
|
|
|
deploy-rs = {
|
|
|
|
url = "github:serokell/deploy-rs";
|
2022-01-24 11:17:44 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2022-12-06 13:44:15 +01:00
|
|
|
inputs.utils.follows = "flake-utils";
|
2022-01-24 11:17:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
naersk = {
|
|
|
|
url = "github:nix-community/naersk";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
rust-overlay = {
|
|
|
|
url = "github:oxalica/rust-overlay";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
|
|
|
|
2021-11-26 22:21:16 +01:00
|
|
|
sops = {
|
|
|
|
url = "github:Mic92/sops-nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2022-02-09 08:13:16 +01:00
|
|
|
emacs-overlay = {
|
|
|
|
url = "github:nix-community/emacs-overlay";
|
2022-05-11 16:27:19 +02:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
2022-02-09 08:13:16 +01:00
|
|
|
};
|
|
|
|
|
2022-10-30 21:11:48 +01:00
|
|
|
hyprland = {
|
|
|
|
url = "github:Hyprwm/Hyprland";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2022-11-22 17:33:35 +01:00
|
|
|
nil = {
|
|
|
|
url = "github:oxalica/nil";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
inputs.rust-overlay.follows = "rust-overlay";
|
|
|
|
};
|
|
|
|
|
|
|
|
nomachine = {
|
|
|
|
url = "github:rytec-nl/nixpkgs/submit/add-nomachine-server";
|
|
|
|
};
|
|
|
|
|
2021-11-21 19:07:12 +01:00
|
|
|
ha-now-playing = {
|
2022-03-18 21:14:51 +01:00
|
|
|
url = "git+https://git.datarift.nl/erwin/ha-now-playing.git?ref=main";
|
2021-11-21 19:07:12 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2022-11-19 20:00:54 +01:00
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
2022-01-24 11:17:44 +01:00
|
|
|
inputs.naersk.follows = "naersk";
|
|
|
|
inputs.rust-overlay.follows = "rust-overlay";
|
2022-11-19 20:00:54 +01:00
|
|
|
inputs.pre-commit-hooks.follows = "pre-commit-hooks";
|
2021-11-21 19:07:12 +01:00
|
|
|
};
|
2021-10-05 23:45:02 +02:00
|
|
|
|
2021-11-21 19:07:12 +01:00
|
|
|
pamedia = {
|
2022-03-18 21:14:51 +01:00
|
|
|
url = "git+https://git.datarift.nl/erwin/pamedia-rs.git?ref=main";
|
2021-11-21 19:07:12 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.utils.follows = "flake-utils";
|
2022-01-24 11:17:44 +01:00
|
|
|
inputs.naersk.follows = "naersk";
|
2021-11-21 19:07:12 +01:00
|
|
|
};
|
2022-09-27 20:38:45 +02:00
|
|
|
|
|
|
|
sunshine = {
|
2022-10-17 22:19:37 +02:00
|
|
|
url = "git+https://git@git.datarift.nl/erwin/sunshine.git?ref=main";
|
2022-09-27 20:38:45 +02:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
2021-11-12 07:23:46 +01:00
|
|
|
};
|
2021-10-05 23:45:02 +02:00
|
|
|
|
2022-04-27 00:21:19 +02:00
|
|
|
outputs =
|
|
|
|
{ self
|
|
|
|
, sops
|
|
|
|
, ha-now-playing
|
|
|
|
, pamedia
|
2022-12-06 13:44:15 +01:00
|
|
|
, deploy-rs
|
2022-04-27 00:21:19 +02:00
|
|
|
, ...
|
|
|
|
} @ inputs:
|
|
|
|
with inputs; let
|
2022-10-13 14:14:30 +02:00
|
|
|
machines = import ./machines inputs;
|
2022-04-27 00:21:19 +02:00
|
|
|
defSystem = system: baseConfig:
|
|
|
|
nixpkgs.lib.nixosSystem {
|
|
|
|
system = "${system}";
|
|
|
|
modules = [
|
|
|
|
{ _module.args.inputs = inputs; }
|
2022-05-19 21:39:19 +02:00
|
|
|
{ _module.args.self-overlay = self.overlays.default; }
|
2022-04-27 00:21:19 +02:00
|
|
|
({ ... }: {
|
|
|
|
imports =
|
|
|
|
builtins.attrValues self.nixosModules
|
|
|
|
++ [
|
|
|
|
{
|
|
|
|
nix.nixPath = [ "nixpkgs=${nixpkgs}" ];
|
2022-11-22 17:33:35 +01:00
|
|
|
nixpkgs =
|
|
|
|
let
|
|
|
|
nomachine-pkgs = import inputs.nomachine {
|
|
|
|
inherit system;
|
|
|
|
config.allowUnfree = true;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
overlays = [
|
|
|
|
self.overlays.default
|
|
|
|
ha-now-playing.overlays.${system}
|
|
|
|
pamedia.overlays.${system}
|
|
|
|
inputs.emacs-overlay.overlay
|
|
|
|
inputs.nil.overlays.default
|
|
|
|
(_final: _prev: {
|
|
|
|
nomachine = nomachine-pkgs.nomachine;
|
|
|
|
})
|
|
|
|
] ++ nixpkgs.lib.optional (system == "aarch64-linux")
|
|
|
|
(_final: super: {
|
|
|
|
makeModulesClosure = x:
|
|
|
|
super.makeModulesClosure (x // { allowMissing = true; });
|
|
|
|
});
|
|
|
|
|
|
|
|
config.allowUnfree = true;
|
|
|
|
};
|
2022-04-27 00:21:19 +02: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;
|
|
|
|
})
|
|
|
|
sops.nixosModules.sops
|
2022-09-27 20:38:45 +02:00
|
|
|
inputs.sunshine.nixosModules.sunshine
|
2022-11-01 19:59:28 +01:00
|
|
|
inputs.hyprland.nixosModules.default
|
2022-04-27 00:21:19 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
in
|
2022-03-01 22:19:03 +01:00
|
|
|
{
|
2022-10-13 14:14:30 +02:00
|
|
|
|
2022-05-19 21:39:19 +02:00
|
|
|
overlays.default = import ./overlays;
|
2022-03-01 22:19:03 +01:00
|
|
|
# overlay = final: prev: {
|
|
|
|
# unstable = import nixpkgs {
|
|
|
|
# system = "x86_64-linux";
|
|
|
|
# config.allowUnfree = true;
|
|
|
|
# };
|
|
|
|
# };
|
|
|
|
|
|
|
|
nixosModules = builtins.listToAttrs (map
|
2022-03-18 21:14:51 +01:00
|
|
|
(x: {
|
|
|
|
name = x;
|
|
|
|
value = import (./modules + "/${x}");
|
|
|
|
})
|
|
|
|
(builtins.attrNames (builtins.readDir ./modules)));
|
2021-10-05 23:45:02 +02:00
|
|
|
|
2022-10-13 14:14:30 +02:00
|
|
|
nixosConfigurations = builtins.listToAttrs (map
|
|
|
|
(machine: {
|
|
|
|
name = machine;
|
2022-11-19 20:00:54 +01:00
|
|
|
value = defSystem (machines.${machine}.system or "x86_64-linux") {
|
2022-10-13 14:14:30 +02:00
|
|
|
imports = [
|
|
|
|
machines.${machine}.config
|
|
|
|
];
|
2022-11-19 20:00:54 +01:00
|
|
|
};
|
2022-10-13 14:14:30 +02:00
|
|
|
})
|
|
|
|
(builtins.attrNames machines));
|
2022-12-06 15:40:12 +01:00
|
|
|
|
|
|
|
deploy.nodes = {
|
|
|
|
gitea = {
|
|
|
|
hostname = "10.0.0.201";
|
|
|
|
# fastConnection = true;
|
|
|
|
|
|
|
|
profiles = {
|
|
|
|
system = {
|
|
|
|
sshUser = "root";
|
|
|
|
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.gitea;
|
|
|
|
user = "root";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-03-01 22:19:03 +01:00
|
|
|
}
|
2022-04-27 00:21:19 +02:00
|
|
|
// (flake-utils.lib.eachSystem [ "aarch64-linux" "x86_64-linux" ])
|
|
|
|
(
|
|
|
|
system:
|
|
|
|
let
|
2022-11-11 23:17:24 +01:00
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [
|
|
|
|
self.overlays.default
|
|
|
|
ha-now-playing.overlays.${system}
|
|
|
|
pamedia.overlays.${system}
|
|
|
|
];
|
|
|
|
config = {
|
|
|
|
allowUnsupportedSystem = true;
|
|
|
|
allowUnfree = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
# pkgs = nixpkgs.legacyPackages.${system};
|
2022-04-27 00:21:19 +02:00
|
|
|
in
|
2022-11-11 20:38:33 +01:00
|
|
|
{
|
2022-11-11 23:17:24 +01:00
|
|
|
packages = flake-utils.lib.flattenTree {
|
|
|
|
rofi-wayland = pkgs.rofi-wayland;
|
|
|
|
nix-plugins = pkgs.nix-plugins;
|
|
|
|
backscrub = pkgs.backscrub;
|
|
|
|
bl3auto = pkgs.bl3auto;
|
2022-12-06 13:44:15 +01:00
|
|
|
commitgpt = pkgs.commitgpt;
|
2022-11-11 23:17:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
apps = {
|
|
|
|
rofi-wayland = flake-utils.lib.mkApp { drv = packages.rofi-wayland; };
|
|
|
|
nix-plugins = flake-utils.lib.mkApp { drv = packages.nix-plugins; };
|
|
|
|
backscrub = flake-utils.lib.mkApp { drv = packages.backscrub; };
|
|
|
|
};
|
2022-04-27 00:21:19 +02:00
|
|
|
|
2022-11-19 20:00:54 +01:00
|
|
|
checks = {
|
|
|
|
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
|
|
|
src = ./.;
|
|
|
|
hooks = {
|
|
|
|
nixpkgs-fmt.enable = true;
|
|
|
|
deadnix.enable = true;
|
|
|
|
statix.enable = true;
|
|
|
|
black.enable = true;
|
|
|
|
shellcheck = {
|
|
|
|
enable = true;
|
|
|
|
types_or = [ "executable" ];
|
|
|
|
};
|
|
|
|
shfmt.enable = true;
|
|
|
|
};
|
|
|
|
};
|
2022-12-06 15:40:12 +01:00
|
|
|
|
|
|
|
} // deploy-rs.lib.${system}.deployChecks self.deploy;
|
2022-11-19 20:00:54 +01:00
|
|
|
|
2022-05-30 14:52:02 +02:00
|
|
|
devShells.default = with pkgs;
|
2022-04-27 00:21:19 +02:00
|
|
|
mkShell {
|
2022-11-19 20:00:54 +01:00
|
|
|
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
2022-11-19 17:22:38 +01:00
|
|
|
name = "dotfiles";
|
2022-05-30 14:52:02 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgs.sops
|
|
|
|
ssh-to-pgp
|
2022-09-07 22:59:08 +02:00
|
|
|
ssh-to-age
|
2022-09-21 18:35:36 +02:00
|
|
|
age
|
2022-06-27 10:09:28 +02:00
|
|
|
nodejs-18_x
|
|
|
|
nodePackages.typescript-language-server
|
2022-09-07 22:59:08 +02:00
|
|
|
nodePackages.yaml-language-server
|
2022-11-08 09:46:07 +01:00
|
|
|
nodePackages.vscode-css-languageserver-bin
|
2022-11-19 17:22:38 +01:00
|
|
|
python3Packages.python-lsp-server
|
2022-10-05 11:31:22 +02:00
|
|
|
statix
|
2022-10-05 15:36:12 +02:00
|
|
|
multimarkdown
|
|
|
|
pngcrush
|
2022-10-11 14:05:22 +02:00
|
|
|
nix-diff
|
2022-10-17 22:19:37 +02:00
|
|
|
popsicle
|
2022-10-30 21:11:07 +01:00
|
|
|
nix-prefetch
|
|
|
|
nix-prefetch-scripts
|
|
|
|
nix-prefetch-github
|
|
|
|
nix-prefetch-docker
|
2022-11-11 11:54:21 +01:00
|
|
|
nixos-install-tools
|
2022-12-06 13:44:15 +01:00
|
|
|
deploy-rs.packages.${system}.deploy-rs
|
2022-11-23 19:55:11 +01:00
|
|
|
|
|
|
|
eww-wayland
|
2022-05-30 14:52:02 +02:00
|
|
|
];
|
2022-04-27 00:21:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
formatter = pkgs.nixpkgs-fmt;
|
|
|
|
}
|
|
|
|
);
|
2021-10-05 23:45:02 +02:00
|
|
|
}
|