2021-09-08 19:43:08 +02:00
|
|
|
{
|
|
|
|
description = "My awesome system config";
|
2021-09-15 00:41:46 +02:00
|
|
|
|
2021-09-08 19:43:08 +02:00
|
|
|
inputs = {
|
2023-04-10 15:12:45 +02:00
|
|
|
# Nix
|
2023-03-13 21:16:40 +01:00
|
|
|
agenix.inputs.nixpkgs.follows = "nixpkgs";
|
2023-04-10 15:12:45 +02:00
|
|
|
agenix.url = "github:ryantm/agenix";
|
2024-11-18 09:31:47 +01:00
|
|
|
|
2023-09-27 13:29:34 +02:00
|
|
|
devshell.url = "github:numtide/devshell";
|
2024-11-18 09:31:47 +01:00
|
|
|
|
2023-09-27 13:29:34 +02:00
|
|
|
disko.url = "github:nix-community/disko";
|
2024-11-18 09:31:47 +01:00
|
|
|
|
2023-09-27 13:29:34 +02:00
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2024-11-18 09:31:47 +01:00
|
|
|
|
2023-03-13 21:16:40 +01:00
|
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
2024-03-21 17:19:06 +01:00
|
|
|
home-manager.url = "github:nix-community/home-manager";
|
2024-11-18 09:31:47 +01:00
|
|
|
|
2023-09-27 13:29:34 +02:00
|
|
|
impermanence.url = "github:nix-community/impermanence";
|
2024-11-18 09:31:47 +01:00
|
|
|
|
2023-09-27 13:29:34 +02:00
|
|
|
master.url = "github:nixos/nixpkgs";
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
2024-06-19 09:16:42 +02:00
|
|
|
stable.url = "github:nixos/nixpkgs/nixos-24.05";
|
2024-11-18 09:31:47 +01:00
|
|
|
|
|
|
|
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
|
|
|
|
|
2023-10-10 11:51:41 +02:00
|
|
|
nur.url = "github:nix-community/NUR";
|
2024-11-18 09:31:47 +01:00
|
|
|
|
2023-10-10 11:50:54 +02:00
|
|
|
nix-index-database.url = "github:Mic92/nix-index-database";
|
|
|
|
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
|
2022-04-18 12:33:07 +02:00
|
|
|
|
2024-11-18 09:31:47 +01:00
|
|
|
nixos-facter-modules.url = "github:numtide/nixos-facter-modules";
|
|
|
|
|
2024-02-16 11:02:24 +01:00
|
|
|
nix-monitored.url = "github:ners/nix-monitored";
|
|
|
|
nix-monitored.inputs.nixpkgs.follows = "nixpkgs";
|
2024-11-18 09:31:47 +01:00
|
|
|
|
|
|
|
# Programs
|
2023-09-27 13:29:34 +02:00
|
|
|
timers.url = "git+https://gitea.moritzboeh.me/moritz/timers.git";
|
2023-09-25 18:29:29 +02:00
|
|
|
|
2023-04-10 15:12:45 +02:00
|
|
|
# Neovim
|
2023-11-30 14:46:29 +01:00
|
|
|
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
|
2023-09-06 08:58:23 +02:00
|
|
|
|
2024-08-31 10:14:44 +02:00
|
|
|
nixvim.url = "github:nix-community/nixvim";
|
|
|
|
nixvim.inputs.devshell.follows = "devshell";
|
|
|
|
nixvim.inputs.flake-parts.follows = "flake-parts";
|
|
|
|
nixvim.inputs.home-manager.follows = "home-manager";
|
|
|
|
|
2024-03-24 13:16:27 +01:00
|
|
|
# river
|
|
|
|
river.url = "git+https://github.com/riverwm/river?submodules=1";
|
|
|
|
river.flake = false;
|
|
|
|
|
2023-04-10 15:12:45 +02:00
|
|
|
# Hyprland
|
|
|
|
hypr-contrib.url = "github:hyprwm/contrib";
|
2024-06-24 09:42:58 +02:00
|
|
|
hyprland = {
|
|
|
|
type = "git";
|
|
|
|
url = "https://github.com/hyprwm/Hyprland";
|
|
|
|
submodules = true;
|
|
|
|
};
|
2023-03-13 21:16:40 +01:00
|
|
|
|
2023-04-10 15:12:45 +02:00
|
|
|
# Laptop
|
|
|
|
asus-touchpad-numpad-driver.url = "github:MoritzBoehme/asus-touchpad-numpad-driver/german-layout";
|
|
|
|
asus-touchpad-numpad-driver.flake = false;
|
2023-03-13 21:23:34 +01:00
|
|
|
|
2023-04-10 15:12:45 +02:00
|
|
|
# Firefox user.js
|
|
|
|
arkenfox-userjs.url = "github:arkenfox/user.js";
|
|
|
|
arkenfox-userjs.flake = false;
|
2024-10-25 07:35:36 +02:00
|
|
|
|
2024-11-22 19:47:22 +01:00
|
|
|
search.url = "github:NuschtOS/search";
|
|
|
|
|
2024-10-25 07:35:36 +02:00
|
|
|
ghostty.url = "git+ssh://git@github.com/ghostty-org/ghostty";
|
2021-09-08 19:43:08 +02:00
|
|
|
};
|
|
|
|
|
2023-09-27 12:38:41 +02:00
|
|
|
outputs = inputs@{ self, flake-parts, ... }:
|
|
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
2024-06-17 10:01:08 +02:00
|
|
|
debug = true; # NOTE: for nixd
|
2023-09-27 12:38:41 +02:00
|
|
|
imports = [
|
|
|
|
inputs.pre-commit-hooks.flakeModule
|
|
|
|
inputs.devshell.flakeModule
|
|
|
|
];
|
2022-12-30 18:58:13 +01:00
|
|
|
|
2023-09-27 12:38:41 +02:00
|
|
|
systems = [ "x86_64-linux" ];
|
|
|
|
perSystem = { config, self', inputs', pkgs, system, ... }: {
|
|
|
|
devshells.default = {
|
|
|
|
devshell.startup.pre-commit-hook.text = config.pre-commit.installationScript;
|
|
|
|
commands = [
|
|
|
|
{
|
|
|
|
name = "agenix";
|
|
|
|
help = "wrapper around agenix";
|
|
|
|
command = ''
|
|
|
|
sudo EDITOR="${pkgs.lib.getExe pkgs.vim}" ${pkgs.lib.getExe' inputs'.agenix.packages.default "agenix"} --identity /etc/ssh/ssh_host_ed25519_key "$@"
|
|
|
|
'';
|
|
|
|
}
|
2024-10-17 13:04:30 +02:00
|
|
|
{
|
|
|
|
name = "vim-startuptime";
|
|
|
|
help = "test vim startup time";
|
|
|
|
command = "${pkgs.lib.getExe pkgs.hyperfine} --warmup 5 --prepare 'sleep 2' 'vim -c exit'";
|
|
|
|
}
|
2023-09-27 12:38:41 +02:00
|
|
|
];
|
2023-11-03 13:48:47 +01:00
|
|
|
packages = with pkgs; [
|
|
|
|
stylua
|
|
|
|
sumneko-lua-language-server
|
2024-08-31 10:14:44 +02:00
|
|
|
nixpkgs-fmt
|
2024-11-18 09:31:47 +01:00
|
|
|
nh
|
2023-11-03 13:48:47 +01:00
|
|
|
];
|
2023-09-27 12:38:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
pre-commit = {
|
|
|
|
check.enable = true;
|
|
|
|
settings = {
|
|
|
|
hooks = {
|
|
|
|
nixpkgs-fmt.enable = true;
|
|
|
|
statix.enable = true;
|
|
|
|
shellcheck.enable = true;
|
|
|
|
stylua.enable = true;
|
2023-05-11 21:48:38 +02:00
|
|
|
};
|
2023-09-27 12:38:41 +02:00
|
|
|
};
|
2023-05-11 21:48:38 +02:00
|
|
|
};
|
2021-09-08 19:43:08 +02:00
|
|
|
|
2023-09-27 12:38:41 +02:00
|
|
|
legacyPackages = pkgs;
|
2024-11-22 19:47:22 +01:00
|
|
|
packages =
|
|
|
|
let
|
|
|
|
modules = [
|
|
|
|
{ name = "My stuff"; }
|
|
|
|
];
|
|
|
|
mkName = name: "${name} Search";
|
|
|
|
mkSearch = name: value: inputs'.search.packages.mkSearch {
|
|
|
|
urlPrefix = "file://${self}/flake.nix";
|
|
|
|
title = mkName name;
|
|
|
|
optionsJSON = "${(pkgs.nixosOptionsDoc { inherit (value) options; warningsAreErrors = false; }).optionsJSON}/share/doc/nixos/options.json";
|
|
|
|
};
|
|
|
|
serveSearch = name: value:
|
|
|
|
pkgs.writeShellApplication {
|
|
|
|
name = mkName name;
|
|
|
|
text = ''
|
|
|
|
xdg-open http://127.0.0.1:8080
|
|
|
|
static-web-server -p 8080 -d ${mkSearch name value}
|
|
|
|
'';
|
|
|
|
runtimeInputs = with pkgs; [ static-web-server xdg-utils ];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
pkgs.lib.mapAttrs serveSearch self.nixosConfigurations;
|
2023-09-27 12:38:41 +02:00
|
|
|
};
|
2021-10-05 13:58:06 +02:00
|
|
|
|
2023-09-27 12:38:41 +02:00
|
|
|
flake = {
|
|
|
|
lib = inputs.nixpkgs.lib.extend
|
|
|
|
(self: _: { my = import ./lib { lib = self; }; });
|
2022-10-15 19:05:51 +02:00
|
|
|
|
2023-09-27 12:38:41 +02:00
|
|
|
nixosConfigurations = self.lib.my.mapModules
|
2023-09-27 13:29:34 +02:00
|
|
|
(path: self.lib.nixosSystem {
|
|
|
|
inherit (self) lib;
|
|
|
|
specialArgs = {
|
|
|
|
inherit inputs self;
|
|
|
|
};
|
|
|
|
modules =
|
|
|
|
[
|
|
|
|
./modules
|
|
|
|
{
|
|
|
|
home-manager = {
|
|
|
|
useGlobalPkgs = true;
|
|
|
|
useUserPackages = true;
|
|
|
|
extraSpecialArgs = { inherit inputs self; };
|
2024-08-31 10:14:44 +02:00
|
|
|
sharedModules = [
|
|
|
|
inputs.nixvim.homeManagerModules.nixvim
|
|
|
|
];
|
2023-09-27 13:29:34 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
inputs.agenix.nixosModules.age
|
|
|
|
inputs.disko.nixosModules.default
|
|
|
|
inputs.home-manager.nixosModule
|
|
|
|
inputs.impermanence.nixosModules.impermanence
|
2023-10-10 11:50:54 +02:00
|
|
|
inputs.nix-index-database.nixosModules.nix-index
|
2024-10-25 12:34:49 +02:00
|
|
|
inputs.nixos-facter-modules.nixosModules.facter
|
2023-09-27 13:29:34 +02:00
|
|
|
path
|
|
|
|
];
|
|
|
|
})
|
2023-09-27 12:38:41 +02:00
|
|
|
./hosts;
|
2023-11-03 14:14:39 +01:00
|
|
|
|
|
|
|
templates = {
|
|
|
|
python = {
|
2024-01-20 13:08:31 +01:00
|
|
|
description = "Simple poetry shell.nix";
|
2023-11-03 14:14:39 +01:00
|
|
|
path = ./templates/python;
|
|
|
|
};
|
2024-01-20 13:08:31 +01:00
|
|
|
rust = {
|
|
|
|
description = "Crane + Fenix flake with mold for faster local builds.";
|
|
|
|
path = ./templates/rust;
|
|
|
|
};
|
2023-11-03 14:14:39 +01:00
|
|
|
};
|
2023-09-27 12:38:41 +02:00
|
|
|
};
|
2021-09-08 19:43:08 +02:00
|
|
|
};
|
2023-09-23 09:50:12 +02:00
|
|
|
|
|
|
|
nixConfig = {
|
|
|
|
extra-substituters = [
|
2024-11-18 09:31:47 +01:00
|
|
|
# "https://hyprland.cachix.org"
|
2023-09-23 09:50:12 +02:00
|
|
|
"https://nix-community.cachix.org"
|
|
|
|
"https://pre-commit-hooks.cachix.org"
|
2024-11-18 09:31:47 +01:00
|
|
|
# "https://ghostty.cachix.org"
|
|
|
|
"https://cache.lix.systems"
|
2023-09-23 09:50:12 +02:00
|
|
|
];
|
|
|
|
extra-trusted-public-keys = [
|
2024-11-18 09:31:47 +01:00
|
|
|
# "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
2023-09-23 09:50:12 +02:00
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
|
|
"pre-commit-hooks.cachix.org-1:Pkk3Panw5AW24TOv6kz3PvLhlH8puAsJTBbOPmBo7Rc="
|
2024-11-18 09:31:47 +01:00
|
|
|
# "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns="
|
|
|
|
"cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
|
2023-09-23 09:50:12 +02:00
|
|
|
];
|
|
|
|
};
|
2021-09-08 19:43:08 +02:00
|
|
|
}
|