2023-09-13 15:42:41 +02:00
|
|
|
rec {
|
|
|
|
description = "felschr's NixOS configuration";
|
|
|
|
|
|
|
|
nixConfig = {
|
|
|
|
extra-substituters = [
|
|
|
|
"https://nix-community.cachix.org"
|
|
|
|
"https://wurzelpfropf.cachix.org" # ragenix
|
|
|
|
"https://felschr.cachix.org"
|
|
|
|
];
|
|
|
|
extra-trusted-public-keys = [
|
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
|
|
"wurzelpfropf.cachix.org-1:ilZwK5a6wJqVr7Fyrzp4blIEkGK+LJT0QrpWr1qBNq0="
|
|
|
|
"felschr.cachix.org-1:raomy5XA2tsVkBoG6wo70ARIn+V24IXhWaSe3QZo12A="
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-07-22 18:49:30 +02:00
|
|
|
inputs = {
|
2023-11-28 00:08:27 +01:00
|
|
|
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.2311.tar.gz";
|
2020-09-23 10:36:46 +02:00
|
|
|
|
2023-09-13 14:00:21 +02:00
|
|
|
nixpkgs-unstable.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.tar.gz";
|
2023-04-09 21:32:37 +02:00
|
|
|
|
2023-09-13 14:00:21 +02:00
|
|
|
nixos-hardware.url =
|
|
|
|
"https://flakehub.com/f/NixOS/nixos-hardware/0.1.tar.gz";
|
2021-05-28 00:19:47 +02:00
|
|
|
|
2023-09-13 14:01:04 +02:00
|
|
|
fh = {
|
|
|
|
url = "https://flakehub.com/f/DeterminateSystems/fh/0.1.tar.gz";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2023-07-22 18:49:30 +02:00
|
|
|
flake-parts = {
|
|
|
|
url = "github:hercules-ci/flake-parts";
|
|
|
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
|
|
|
};
|
2020-09-24 12:35:45 +02:00
|
|
|
|
2023-09-13 14:00:21 +02:00
|
|
|
flake-utils.url = "https://flakehub.com/f/numtide/flake-utils/0.1.tar.gz";
|
2020-09-23 10:36:46 +02:00
|
|
|
|
2023-07-22 18:49:30 +02:00
|
|
|
home-manager = {
|
2023-11-28 00:08:27 +01:00
|
|
|
url = "https://flakehub.com/f/nix-community/home-manager/0.2311.tar.gz";
|
2023-07-22 18:49:30 +02:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2020-09-23 10:36:46 +02:00
|
|
|
|
2023-09-30 03:31:46 +02:00
|
|
|
firefox-addons = {
|
|
|
|
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
arkenfox-userjs = {
|
|
|
|
url = "github:arkenfox/user.js";
|
|
|
|
flake = false;
|
|
|
|
};
|
2022-05-04 03:02:47 +02:00
|
|
|
|
2023-07-22 18:49:30 +02:00
|
|
|
agenix = {
|
2023-08-10 11:43:39 +02:00
|
|
|
url = "github:yaxitech/ragenix";
|
2023-07-22 18:49:30 +02:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2023-08-10 11:43:39 +02:00
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
2023-07-22 18:49:30 +02:00
|
|
|
};
|
2022-05-05 21:24:46 +02:00
|
|
|
|
2023-07-22 18:49:30 +02:00
|
|
|
deploy-rs = {
|
|
|
|
url = "github:serokell/deploy-rs";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.utils.follows = "flake-utils";
|
|
|
|
};
|
2020-09-24 12:35:45 +02:00
|
|
|
|
2023-07-22 18:49:30 +02:00
|
|
|
pre-commit-hooks = {
|
|
|
|
url = "github:cachix/pre-commit-hooks.nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.nixpkgs-stable.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
|
|
|
|
2023-07-29 21:41:11 +02:00
|
|
|
matrix-appservices = {
|
|
|
|
url = "gitlab:coffeetables/nix-matrix-appservices";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2023-07-22 18:49:30 +02:00
|
|
|
nvim-kitty-navigator = {
|
|
|
|
url = "github:hermitmaster/nvim-kitty-navigator";
|
|
|
|
flake = false;
|
|
|
|
};
|
2022-04-05 19:42:51 +02:00
|
|
|
};
|
|
|
|
|
2023-09-30 16:21:03 +02:00
|
|
|
outputs = { self, nixpkgs, nixpkgs-unstable, ... }@inputs:
|
2023-07-22 18:49:30 +02:00
|
|
|
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
|
|
|
systems = [ "x86_64-linux" "aarch64-linux" ];
|
2024-01-30 19:40:49 +01:00
|
|
|
imports = [ ./pkgs/flake-module.nix ./lib ./overlays.nix ];
|
2023-09-30 16:21:03 +02:00
|
|
|
flake = {
|
|
|
|
inherit nixConfig;
|
2023-07-22 20:33:36 +02:00
|
|
|
|
2023-07-22 18:49:30 +02:00
|
|
|
nixosModules = {
|
|
|
|
flakeDefaults = import ./modules/flakeDefaults.nix;
|
|
|
|
systemdNotify = import ./modules/systemdNotify.nix;
|
2023-10-04 19:45:46 +02:00
|
|
|
inadyn = import ./modules/inadyn.nix;
|
2023-07-22 18:49:30 +02:00
|
|
|
};
|
2020-09-27 14:27:25 +02:00
|
|
|
|
2023-07-22 18:49:30 +02:00
|
|
|
homeManagerModules = {
|
|
|
|
git = import ./home/modules/git.nix;
|
|
|
|
firefox = import ./home/modules/firefox/firefox.nix;
|
|
|
|
tor-browser = import ./home/modules/firefox/tor-browser.nix;
|
2023-09-13 14:01:43 +02:00
|
|
|
mullvad-browser = import ./home/modules/firefox/mullvad-browser.nix;
|
2022-05-05 21:24:46 +02:00
|
|
|
};
|
|
|
|
|
2023-07-22 18:49:30 +02:00
|
|
|
nixosConfigurations = {
|
|
|
|
home-pc = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
nixpkgs.nixosModules.notDetected
|
2023-09-30 16:21:03 +02:00
|
|
|
inputs.nixos-hardware.nixosModules.common-pc
|
|
|
|
inputs.nixos-hardware.nixosModules.common-pc-ssd
|
|
|
|
inputs.nixos-hardware.nixosModules.common-cpu-amd-pstate
|
|
|
|
inputs.nixos-hardware.nixosModules.common-gpu-amd
|
|
|
|
(self.lib.createSystem "home-pc" {
|
2023-07-22 18:49:30 +02:00
|
|
|
hardwareConfig = ./hardware/home-pc.nix;
|
2023-08-13 00:28:29 +02:00
|
|
|
config = ./hosts/home-pc.nix;
|
2023-07-22 18:49:30 +02:00
|
|
|
})
|
2023-09-30 16:21:03 +02:00
|
|
|
self.lib.createMediaGroup
|
|
|
|
(self.lib.createUser "felschr" {
|
2023-09-29 15:41:16 +02:00
|
|
|
user.extraGroups =
|
|
|
|
[ "wheel" "audio" "disk" "libvirtd" "qemu-libvirtd" "media" ];
|
2023-09-30 16:21:03 +02:00
|
|
|
modules = [ self.homeManagerModules.git ];
|
2023-07-22 18:49:30 +02:00
|
|
|
config = ./home/felschr.nix;
|
2023-09-18 23:39:37 +02:00
|
|
|
usesContainers = true;
|
2023-07-22 18:49:30 +02:00
|
|
|
})
|
|
|
|
({ pkgs, ... }: {
|
|
|
|
environment.systemPackages =
|
2023-09-30 16:21:03 +02:00
|
|
|
[ inputs.deploy-rs.defaultPackage.x86_64-linux ];
|
2023-07-22 18:49:30 +02:00
|
|
|
})
|
|
|
|
];
|
2023-09-30 16:21:03 +02:00
|
|
|
specialArgs = { inherit inputs; };
|
2023-07-22 18:49:30 +02:00
|
|
|
};
|
|
|
|
pilot1 = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
nixpkgs.nixosModules.notDetected
|
2023-09-30 16:21:03 +02:00
|
|
|
inputs.nixos-hardware.nixosModules.common-pc
|
|
|
|
inputs.nixos-hardware.nixosModules.common-pc-ssd
|
|
|
|
inputs.nixos-hardware.nixosModules.common-cpu-intel
|
2023-11-28 00:09:59 +01:00
|
|
|
inputs.nixos-hardware.nixosModules.common-gpu-intel
|
2023-09-30 16:21:03 +02:00
|
|
|
(self.lib.createSystem "pilot1" {
|
2023-07-22 18:49:30 +02:00
|
|
|
hardwareConfig = ./hardware/pilot1.nix;
|
2023-08-13 00:28:29 +02:00
|
|
|
config = ./hosts/work-pc.nix;
|
2023-07-22 18:49:30 +02:00
|
|
|
})
|
2023-09-30 16:21:03 +02:00
|
|
|
(self.lib.createUser "felschr" {
|
2023-07-22 18:49:30 +02:00
|
|
|
user.extraGroups = [ "wheel" "audio" "disk" ];
|
2023-09-30 16:21:03 +02:00
|
|
|
modules = [ self.homeManagerModules.git ];
|
2023-07-22 18:49:30 +02:00
|
|
|
config = ./home/felschr-work.nix;
|
2023-09-18 23:39:37 +02:00
|
|
|
usesContainers = true;
|
2023-07-22 18:49:30 +02:00
|
|
|
})
|
|
|
|
];
|
2023-09-30 16:21:03 +02:00
|
|
|
specialArgs = { inherit inputs; };
|
2023-07-22 18:49:30 +02:00
|
|
|
};
|
|
|
|
home-server = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
nixpkgs.nixosModules.notDetected
|
2023-09-30 16:21:03 +02:00
|
|
|
inputs.nixos-hardware.nixosModules.common-pc
|
|
|
|
inputs.nixos-hardware.nixosModules.common-pc-ssd
|
|
|
|
inputs.nixos-hardware.nixosModules.common-cpu-intel-kaby-lake
|
2023-11-28 00:09:59 +01:00
|
|
|
inputs.nixos-hardware.nixosModules.common-gpu-intel
|
2023-09-30 16:21:03 +02:00
|
|
|
inputs.matrix-appservices.nixosModule
|
|
|
|
(self.lib.createSystem "home-server" {
|
2023-07-22 18:49:30 +02:00
|
|
|
hardwareConfig = ./hardware/lattepanda.nix;
|
2023-08-13 00:28:29 +02:00
|
|
|
config = ./hosts/home-server.nix;
|
2023-07-22 18:49:30 +02:00
|
|
|
})
|
2023-09-30 16:21:03 +02:00
|
|
|
self.lib.createMediaGroup
|
|
|
|
(self.lib.createUser "felschr" {
|
2023-07-22 18:49:30 +02:00
|
|
|
user = {
|
|
|
|
extraGroups = [ "wheel" "audio" "disk" "media" ];
|
|
|
|
openssh.authorizedKeys.keys = [
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP751vlJUnB7Pfe1KNr6weWkx/rkP4J3lTYpAekHdOgV"
|
|
|
|
];
|
|
|
|
};
|
2023-09-30 16:21:03 +02:00
|
|
|
modules = [ self.homeManagerModules.git ];
|
2023-07-22 18:49:30 +02:00
|
|
|
config = ./home/felschr-server.nix;
|
|
|
|
})
|
|
|
|
];
|
2023-09-30 16:21:03 +02:00
|
|
|
specialArgs = { inherit inputs; };
|
2023-07-22 18:49:30 +02:00
|
|
|
};
|
2022-08-08 22:52:32 +02:00
|
|
|
};
|
2022-05-12 11:31:05 +02:00
|
|
|
|
2023-07-22 18:49:30 +02:00
|
|
|
deploy.nodes.home-server = {
|
|
|
|
hostname = "192.168.1.102";
|
|
|
|
profiles.system = {
|
2023-07-27 19:14:53 +02:00
|
|
|
sshUser = "felschr";
|
|
|
|
sshOpts = [ "-t" ];
|
|
|
|
user = "root";
|
2023-09-30 16:21:03 +02:00
|
|
|
path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos
|
2023-07-22 18:49:30 +02:00
|
|
|
self.nixosConfigurations.home-server;
|
2023-07-27 19:14:53 +02:00
|
|
|
magicRollback = false; # otherwise password prompt won't work
|
2023-07-22 18:49:30 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-07-22 20:33:36 +02:00
|
|
|
perSystem = { system, config, pkgs, ... }: {
|
|
|
|
_module.args.pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
config.allowUnfree = true;
|
|
|
|
};
|
2022-08-03 01:30:46 +02:00
|
|
|
|
2022-05-12 11:01:01 +02:00
|
|
|
devShells.default =
|
2023-07-22 20:33:36 +02:00
|
|
|
pkgs.mkShell { inherit (config.checks.pre-commit) shellHook; };
|
2022-08-08 23:53:33 +02:00
|
|
|
|
2023-09-30 16:21:03 +02:00
|
|
|
checks = inputs.deploy-rs.lib.${system}.deployChecks self.deploy // {
|
|
|
|
pre-commit = inputs.pre-commit-hooks.lib.${system}.run {
|
2022-08-08 23:53:33 +02:00
|
|
|
src = ./.;
|
|
|
|
hooks = {
|
|
|
|
nixfmt.enable = true;
|
|
|
|
shellcheck.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-07-22 18:49:30 +02:00
|
|
|
|
|
|
|
formatter = pkgs.nixfmt;
|
|
|
|
};
|
|
|
|
};
|
2020-09-23 10:36:46 +02:00
|
|
|
}
|