Compare commits

57 Commits

Author SHA1 Message Date
John Lancaster d3fcf013b6 pruning 2026-03-26 23:07:29 -05:00
John Lancaster 409fe16b9f secrets update 2026-03-26 22:59:25 -05:00
John Lancaster 13c7ab8d6a secrets update 2026-03-26 22:47:21 -05:00
John Lancaster 16a39dc46e renamed option 2026-03-26 22:43:19 -05:00
John Lancaster 51103ec4a1 flake.lock update 2026-03-26 22:32:51 -05:00
John Lancaster 450be7531d optional vscode in desktop 2026-03-26 22:32:43 -05:00
John Lancaster d008fa5814 rename 2026-03-26 22:32:34 -05:00
John Lancaster 9aadd03d66 lzg alias 2026-03-26 22:24:34 -05:00
John Lancaster cb0c671f47 added git credential oauth 2026-03-26 21:53:16 -05:00
John Lancaster 608a261807 reworked gnome extensions 2026-03-26 21:50:07 -05:00
John Lancaster 1b2698e629 added gnome key bindings 2026-03-26 21:39:20 -05:00
John Lancaster 3a416e716d added vscode module to john-p14s 2026-03-26 21:36:12 -05:00
John Lancaster 52eda301e8 started p14s secrets 2026-03-26 21:26:51 -05:00
John Lancaster 7f69fc6dce disabling wireguard until I can add the key to a sops file 2026-03-26 19:09:38 -05:00
John Lancaster 5ce7ace964 silencing warning about gtk stuff 2026-03-26 19:04:52 -05:00
John Lancaster f0cab4ad1f updated and moved wireguard 2026-03-26 18:57:28 -05:00
John Lancaster 061d5a6f47 added wireguard nixos module 2026-03-26 18:42:31 -05:00
John Lancaster 6ef67a575a added steam nixos module 2026-03-26 18:39:34 -05:00
John Lancaster ea7e53f04d added gnome home module to john-p14s 2026-03-26 18:36:13 -05:00
John Lancaster 4c7da4abfa nixpkgs follows issue 2026-03-26 18:30:28 -05:00
John Lancaster 238e64437c desktop imports 2026-03-26 18:23:59 -05:00
John Lancaster 5dcac56860 removed 1password shell plugin 2026-03-26 18:17:03 -05:00
John Lancaster 73950c72ed home-manager to inputs in john 2026-03-26 18:04:18 -05:00
John Lancaster bdf187b4f9 amd hardware updates 2026-03-26 18:03:56 -05:00
John Lancaster 336166d22d fix 2026-03-26 17:56:54 -05:00
John Lancaster ac525dda78 typo 2026-03-26 17:56:15 -05:00
John Lancaster 4cd6972302 added sudo and john nixos modules to p14s 2026-03-26 17:55:09 -05:00
John Lancaster 76be519c0f added graphics options to p14s hardware 2026-03-26 17:52:41 -05:00
John Lancaster c578bf00a1 formatting 2026-03-26 17:50:19 -05:00
John Lancaster 429d1b7f11 config 2026-03-26 17:39:03 -05:00
John Lancaster 942cc13cf0 displayManager settings 2026-03-26 17:38:12 -05:00
John Lancaster f1e395fd30 enabled touchpad support 2026-03-26 17:37:59 -05:00
John Lancaster 0ebd91234e enabled gnome desktopmanager 2026-03-26 17:31:42 -05:00
John Lancaster 4a235fe1e1 formatting 2026-03-26 17:31:22 -05:00
John Lancaster 4465fd0f90 insecure openssl-1.1.1w 2026-03-26 17:25:03 -05:00
John Lancaster 9c733a135a onepassword 2026-03-26 17:22:18 -05:00
John Lancaster 193e5ee40d pkgs 2026-03-26 17:12:51 -05:00
John Lancaster 71a04c627a desktop fixes 2026-03-26 17:11:33 -05:00
John Lancaster 338ef34212 typo 2026-03-26 16:58:22 -05:00
John Lancaster 1f5319252e lib 2026-03-26 16:57:51 -05:00
John Lancaster 29853f4a35 passing thru pkgs 2026-03-26 16:56:52 -05:00
John Lancaster 9f2a55cfd6 fixes 2026-03-26 16:56:17 -05:00
John Lancaster 1d8e721171 gnome on p14s 2026-03-26 16:53:32 -05:00
John Lancaster 731277aad8 gnome consolidation 2026-03-26 16:49:14 -05:00
John Lancaster bab4dfa131 added ripgrep to shell-tools 2026-03-25 22:32:01 -05:00
John Lancaster 2c8e7e3b63 added niri/noctalia 2026-03-25 22:09:25 -05:00
John Lancaster 2ca7dcc464 reformat 2026-03-25 21:56:59 -05:00
John Lancaster 8b4a2a36b6 pruning 2026-03-25 18:59:17 -05:00
John Lancaster fae745af5a prune 2026-03-25 18:46:02 -05:00
John Lancaster 0d39ac7ca2 prune 2026-03-25 18:44:45 -05:00
John Lancaster 5bbf20aabd prune 2026-03-25 18:44:37 -05:00
John Lancaster 3da3cc2dc6 cleanup 2026-03-25 18:33:54 -05:00
John Lancaster 18b6cc16ad more pruning 2026-03-25 18:17:07 -05:00
John Lancaster d8ced840ca pruning 2026-03-25 18:07:19 -05:00
John Lancaster 2fad88f8a0 added root_ca content 2026-03-25 18:07:08 -05:00
John Lancaster 7b0f419454 WIP CA bootstrap rework 2026-03-25 17:55:31 -05:00
John Lancaster f8c09878a1 started p14s transition 2026-03-25 17:29:37 -05:00
32 changed files with 646 additions and 269 deletions
+5
View File
@@ -9,6 +9,11 @@ creation_rules:
- age: - age:
- *john-pc - *john-pc
- *soteria - *soteria
- path_regex: john-p14s/secrets\.yaml$
key_groups:
- age:
- *john-p14s
- *john-pc
- path_regex: john-pc/secrets\.yaml$ - path_regex: john-pc/secrets\.yaml$
key_groups: key_groups:
- age: - age:
Generated
+52 -67
View File
@@ -2,11 +2,11 @@
"nodes": { "nodes": {
"flake-file": { "flake-file": {
"locked": { "locked": {
"lastModified": 1773554778, "lastModified": 1773637821,
"narHash": "sha256-keH0VNsci9e0Uwt3Msp/N+pltaP8Lb6lt09Q3WvDPw4=", "narHash": "sha256-Cp1x/5/97iNjXOI5hLCA51BwR6hc1dWJiZp4VPogkTw=",
"owner": "vic", "owner": "vic",
"repo": "flake-file", "repo": "flake-file",
"rev": "f4780a86bd4c756475d839b286f8a40aabdbc802", "rev": "bb9fbe00ba6a1945fbdd6973c2585ab770f404b0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -53,34 +53,16 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1773608492, "lastModified": 1774561634,
"narHash": "sha256-QZteyExJYSQzgxqdsesDPbQgjctGG7iKV/6ooyQPITk=", "narHash": "sha256-3q1xsREjqdVIIwQQDZQ9y0YdBzP8gAxdwKoKnZSzJtU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "9a40ec3b78fc688d0908485887d355caa5666d18", "rev": "7c046c63ac3b467c1d589b99d531da5b6520825a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -91,11 +73,11 @@
}, },
"import-tree": { "import-tree": {
"locked": { "locked": {
"lastModified": 1773554199, "lastModified": 1773693634,
"narHash": "sha256-6apV5N1F5tTD8JY9AUGnkWmy56HqDPn4MNFRsq4Rg+s=", "narHash": "sha256-BtZ2dtkBdSUnFPPFc+n0kcMbgaTxzFNPv2iaO326Ffg=",
"owner": "vic", "owner": "vic",
"repo": "import-tree", "repo": "import-tree",
"rev": "c6ebc59c85ee54cfb68163d06d1a3149ce0fe431", "rev": "c41e7d58045f9057880b0d85e1152d6a4430dbf1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -125,13 +107,29 @@
"type": "github" "type": "github"
} }
}, },
"nixos-hardware": {
"flake": false,
"locked": {
"lastModified": 1774567711,
"narHash": "sha256-uVlOHBvt6Vc/iYNJXLPa4c3cLXwMllOCVfAaLAcphIo=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "3f6f874dfc34d386d10e434c48ad966c4832243e",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1773389992, "lastModified": 1774106199,
"narHash": "sha256-wvfdLLWJ2I9oEpDd9PfMA8osfIZicoQ5MT1jIwNs9Tk=", "narHash": "sha256-US5Tda2sKmjrg2lNHQL3jRQ6p96cgfWh3J1QBliQ8Ws=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c06b4ae3d6599a672a6210b7021d699c351eebda", "rev": "6c9a78c09ff4d6c21d0319114873508a6ec01655",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -143,11 +141,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1773507054, "lastModified": 1774273680,
"narHash": "sha256-yzDBkI1CpeZrAt4l1nGvTOs3OFtXCS7a7Gi5Y1h878w=", "narHash": "sha256-WLxi1vfcykjq9Yb2umqBJs6lVM6MpV2tXfcrAjroxUk=",
"rev": "e80236013dc8b77aa49ca90e7a12d86f5d8d64c9", "rev": "fdc7b8f7b30fdbedec91b71ed82f36e1637483ed",
"type": "tarball", "type": "tarball",
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre963414.e80236013dc8/nixexprs.tar.xz" "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.05pre968305.fdc7b8f7b30f/nixexprs.tar.xz"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
@@ -156,16 +154,18 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1682134069, "lastModified": 1773840656,
"narHash": "sha256-TnI/ZXSmRxQDt2sjRYK/8j8iha4B4zP2cnQCZZ3vp7k=", "narHash": "sha256-9tpvMGFteZnd3gRQZFlRCohVpqooygFuy9yjuyRL2C0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "fd901ef4bf93499374c5af385b2943f5801c0833", "rev": "9cf7092bdd603554bd8b63c216e8943cf9b12512",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "owner": "NixOS",
"type": "indirect" "ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
} }
}, },
"root": { "root": {
@@ -175,12 +175,13 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"import-tree": "import-tree", "import-tree": "import-tree",
"nixgl": "nixgl", "nixgl": "nixgl",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nixpkgs-lib": [ "nixpkgs-lib": [
"nixpkgs" "nixpkgs"
], ],
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"vscode-server": "vscode-server" "wrapper-modules": "wrapper-modules"
} }
}, },
"sops-nix": { "sops-nix": {
@@ -190,11 +191,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1773550941, "lastModified": 1774303811,
"narHash": "sha256-wa/++bL2QeMUreNFBZEWluQfOYB0MnQIeGNMuaX9sfs=", "narHash": "sha256-fhG4JAcLgjKwt+XHbjs8brpWnyKUfU4LikLm3s0Q/ic=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "c469b6885f0dcd5c7c56bd935a0f08dbcd9e79e1", "rev": "614e256310e0a4f8a9ccae3fa80c11844fba7042",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -218,37 +219,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_2": { "wrapper-modules": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"vscode-server": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1770124655, "lastModified": 1774538285,
"narHash": "sha256-yHmd2B13EtBUPLJ+x0EaBwNkQr9LTne1arLVxT6hSnY=", "narHash": "sha256-KRDNQDEWjB2O5SRH/oUTzi34cNxlIT8sab0FK2uqZ2g=",
"owner": "nix-community", "owner": "BirdeeHub",
"repo": "nixos-vscode-server", "repo": "nix-wrapper-modules",
"rev": "92ce71c3ba5a94f854e02d57b14af4997ab54ef0", "rev": "15d740b2bfc545189a569147da7718457c12758e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "BirdeeHub",
"repo": "nixos-vscode-server", "repo": "nix-wrapper-modules",
"type": "github" "type": "github"
} }
} }
+8 -6
View File
@@ -1,28 +1,30 @@
# DO-NOT-EDIT. This file was auto-generated using github:vic/flake-file. # DO-NOT-EDIT. This file was auto-generated using github:vic/flake-file.
# Use `nix run .#write-flake` to regenerate it. # Use `nix run .#write-flake` to regenerate it.
{ {
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules); outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules);
inputs = { inputs = {
flake-file.url = "github:vic/flake-file"; flake-file.url = "github:vic/flake-file";
flake-parts = { flake-parts = {
inputs.nixpkgs-lib.follows = "nixpkgs-lib";
url = "github:hercules-ci/flake-parts"; url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs-lib";
}; };
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
import-tree.url = "github:vic/import-tree"; import-tree.url = "github:vic/import-tree";
nixgl = { nixgl = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:nix-community/nixGL"; url = "github:nix-community/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware = {
url = "github:NixOS/nixos-hardware";
flake = false;
}; };
nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"; nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz";
nixpkgs-lib.follows = "nixpkgs"; nixpkgs-lib.follows = "nixpkgs";
sops-nix = { sops-nix = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:Mic92/sops-nix"; url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
}; };
vscode-server.url = "github:nix-community/nixos-vscode-server"; wrapper-modules.url = "github:BirdeeHub/nix-wrapper-modules";
}; };
} }
+16
View File
@@ -0,0 +1,16 @@
# This module is for programs with GUIs that run in a desktop environment
{ self, inputs, ... }: {
flake.modules.homeManager.desktop = { config, pkgs, lib, ... }: {
imports = with inputs.self.modules.homeManager; [
brave
ghostty
onepassword
vscode
];
home.packages = with pkgs; [
mangohud
sublime4
proton-vpn
];
};
}
+111
View File
@@ -0,0 +1,111 @@
{ inputs, ... }: {
flake.modules.nixos.gnome = {pkgs, ... }: {
services = {
desktopManager.gnome.enable = true;
displayManager.gdm = {
enable = true;
wayland = true;
banner = "Welcome to John's NixOS implementation";
};
udev.packages = [
pkgs.gnome-settings-daemon # For gnome systray icons
];
};
# Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
systemd.services."getty@tty1".enable = false;
systemd.services."autovt@tty1".enable = false;
};
flake.modules.homeManager.gnome = { config, pkgs, ... }:
let
# `gnome-extensions list` for a list
extensions = with pkgs.gnomeExtensions; [
appindicator # For gnome systray icons
dash-to-panel
gtile
space-bar
switcher
tactile
vitals
];
enabledExtensions = map (ext: ext.extensionUuid) extensions;
in
{
gtk = {
enable = true;
theme = {
name = "Orchis-Dark";
package = pkgs.orchis-theme;
};
gtk4.theme = config.gtk.theme;
};
home.packages = [ pkgs.gnome-tweaks ] ++ extensions;
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
"org/gnome/shell" = {
disable-user-extensions = false;
enabled-extensions = enabledExtensions;
};
"org/gnome/desktop/wm/preferences" = {
button-layout = ":minimize,close";
};
"org/gnome/desktop/wm/keybindings" = {
"switch-to-workspace-1" = ["<Super>1"];
"switch-to-workspace-2" = ["<Super>2"];
"switch-to-workspace-3" = ["<Super>3"];
"switch-to-workspace-4" = ["<Super>4"];
"move-to-workspace-1" = ["<Shift><Super>1"];
"move-to-workspace-2" = ["<Shift><Super>2"];
"move-to-workspace-3" = ["<Shift><Super>3"];
"move-to-workspace-4" = ["<Shift><Super>4"];
};
"org/gnome/settings-daemon/plugins/media-keys" = {
custom-keybindings = [
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/edit-nix/"
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/launch-browser/"
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/ad-dev/"
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/shutdown/"
];
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/edit-nix" = {
binding = "<Primary><Alt>n";
command = "code /etc/nixos";
name = "Edit Nix config";
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/launch-browser" = {
binding = "<Primary><Alt>b";
command = "brave";
name = "Launch Brave browser";
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/ad-dev" = {
binding = "<Primary><Alt>d";
command = ''code --file-uri "vscode-remote://ssh-remote+ad-nix/etc/nixos/ad-nix.code-workspace"'';
name = "Launch AppDaemon Development over Tailscale";
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/ws1" = {
binding = "<Super>1";
command = "wmctrl -s 0";
name = "Switch to workspace 1";
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/shutdown" = {
binding = "<Primary><Alt>p";
command = "gnome-session-quit --power-off --force";
name = "Shutdown immediately";
};
};
};
}
+28
View File
@@ -0,0 +1,28 @@
# https://github.com/glabrie/dotfiles/blob/main/modules/system/settings/greetd.nix
{ inputs, ... }: {
flake.module.nixos.greetd = { pkgs, lib, ... }: {
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${lib.getExe pkgs.tuigreet} --time --remember --cmd niri-session";
user = "greeter";
};
};
};
systemd.services.greetd.serviceConfig = {
Type = "idle";
StandardInput = "tty";
StandardOutput = "tty";
StandardError = "journal"; # Without this errors will spam on screen
# Without these bootlogs will spam on screen
TTYReset = true;
TTYVHangup = true;
TTYVTDisallocate = true;
};
# Let's allow our keyring to work from the start
security.pam.services.greetd.enableGnomeKeyring = true;
};
}
@@ -2,9 +2,17 @@
let let
username = "john"; username = "john";
hostname = "janus"; hostname = "janus";
caURL = "https://janus.john-stream.com/";
in in
{ {
flake.modules.homeManager.janus-ca = { config, ... }: {
home.file.".step/config/defaults.json".text = builtins.toJSON {
"ca-url" = "https://janus.john-stream.com/";
fingerprint = "2036c44f7b5901566ff7611ea6c927291ecc6d2dd00779c0eead70ec77fa10d6";
root = "${config.home.homeDirectory}/.step/certs/root_ca.crt";
};
home.file.".step/certs/root_ca.crt".source = ./root_ca.crt;
};
flake.nixosConfigurations."${hostname}" = inputs.nixpkgs.lib.nixosSystem { flake.nixosConfigurations."${hostname}" = inputs.nixpkgs.lib.nixosSystem {
modules = with inputs.self.modules; [ modules = with inputs.self.modules; [
nixos.lxc nixos.lxc
@@ -20,12 +28,10 @@ in
networking.hostName = hostname; networking.hostName = hostname;
step-ssh-host = { step-ssh-host = {
hostname = hostname; hostname = hostname;
caURL = caURL;
}; };
mtls = { mtls = {
enable = true; enable = true;
subject = hostname; subject = hostname;
caURL = caURL;
san = [ san = [
"${hostname}.john-stream.com" "${hostname}.john-stream.com"
"192.168.1.244" "192.168.1.244"
@@ -36,18 +42,10 @@ in
imports = with inputs.self.modules.homeManager; [ imports = with inputs.self.modules.homeManager; [
sops sops
step-ssh-user step-ssh-user
janus-ca
]; ];
shell.program = "zsh"; shell.program = "zsh";
docker.enable = true; docker.enable = true;
# step-ssh-user = {
# enable = true;
# principals = [ "${hostname}" ];
# };
ssh.matchSets = {
certs = true;
homelab = true;
};
}; };
} }
]; ];
+101
View File
@@ -0,0 +1,101 @@
{ self, inputs, ... }:
{
flake.modules.nixos.p14sConfiguration = { pkgs, lib, ... }:
let
hostname = "john-p14s";
in
{
imports = [
self.modules.nixos.p14sHardware
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nixpkgs.config = {
permittedInsecurePackages = [ "openssl-1.1.1w" ];
allowUnfree = true;
};
networking = {
hostName = hostname;
networkmanager.enable = true;
};
# Enable automatic login for the user.
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "john";
programs.zsh.enable = true;
services.openssh.enable = true;
services.tailscale.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
wget
cacert
busybox
dig
samba
];
security.pam.services.swaylock = {};
security.pam.services.swaylock.fprintAuth = true;
programs._1password.enable = true;
programs._1password-gui = {
enable = true;
# Certain features, including CLI integration and system authentication support,
# require enabling PolKit integration on some desktop environments (e.g. Plasma).
polkitPolicyOwners = [ "john" ];
# TODO this should not be a hardcoded username
};
# This is needed for VSCode remote support. Read: https://nixos.wiki/wiki/Visual_Studio_Code
programs.nix-ld.enable = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.05"; # Did you read the comment?
# Set your time zone.
time.timeZone = "America/Chicago";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
services.libinput.enable = true; # Enable touchpad support (enabled default in most desktopManager).
services.fprintd.enable = true; # Enables fingerprint sensor
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true; # PulseAudio server uses this to acquire realtime priority.
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
# media-session.enable = true;
};
};
}
+34
View File
@@ -0,0 +1,34 @@
{ self, inputs, ... }: {
flake-file.inputs = {
nixos-hardware = {
url = "github:NixOS/nixos-hardware";
flake = false;
};
};
flake.nixosConfigurations.john-p14s = inputs.nixpkgs.lib.nixosSystem {
modules = [
"${inputs.nixos-hardware}/lenovo/thinkpad/p14s"
"${inputs.nixos-hardware}/lenovo/thinkpad/p14s/amd/gen4"
{
home-manager.useGlobalPkgs = true;
home-manager.users.john.imports = with inputs.self.modules.homeManager; [
gnome
desktop
{
my-vscode.enable = true;
}
];
}
] ++ (with self.modules.nixos; [
p14sConfiguration
sudo
john
gnome
steam
# wireguard
# greetd
# niri
]);
};
}
+59
View File
@@ -0,0 +1,59 @@
{ self, inputs, ... }: {
flake.modules.nixos.p14sHardware = { config, lib, pkgs, modulesPath, ... }: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
initrd = {
availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ];
kernelModules = [ "amdgpu" ];
};
kernelModules = [ "kvm-amd" ];
extraModulePackages = [ ];
};
# boot.loader.systemd-boot.enable = true;
# boot.loader.efi.canTouchEfiVariables = true;
# boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "usbhid" "sd_mod" ];
# boot.initrd.kernelModules = [ "amdgpu" ];
# boot.kernelModules = [ "kvm-amd" ];
# boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/fbc7d8bc-080b-4554-a2b2-5f92d059ce07";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/9A04-ADD8";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp102s0u2u4.useDHCP = lib.mkDefault true;
# networking.interfaces.enp1s0f0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.graphics = {
enable = true;
enable32Bit = true;
extraPackages = [ pkgs.rocmPackages.clr.icd ];
};
environment.variables.AMD_VULKAN_ICD = "RADV";
};
}
+26
View File
@@ -0,0 +1,26 @@
restic_password: ENC[AES256_GCM,data:8KeL7kOMTHkK+ZpY3aq0/S4UYbkZh72FxJAolcVes79NPfdHiNi77fmAZuXb8Gxasu16vk4y6ksWFmrZquvcbg+cLt8Yze+qvuCiUW62IOppzRIBLk6w2f8uPhU41gsVuj6u4Jz/Su7miNBvJYmF8vulIwDKS7qg43dzIKXY4q1HaRHCD12PkU9EfGpIgivdNCOO0lCE6m/O3IB8Ed4R51scBnVrIj89K5OuTepvIrGElmXiWqBdsTzCIaJCZJ8fDnzJPorLhsTAzKCnQhNoIrW/aYArzj9+WmglmGuqeaoemBoNTrYC9bssUwuWAOqsf1HC7gWST/dP9FmKl7UHlgkslblRcRedFPAQjDhy/RgZCj8hs/XrVYOzwW8WJ0XeB9UPK03QPJc8EZdz9r2Q0+U3LQxMV6Jne5JZGsMpII4b+7b/WbRZTooX3G09MES/gzwD+hyBr++6EpP9QTYs+4XsNLNN+S6y5+YS/7XmRvR7xb93eZ4EfUUKiQYejVKQBl9b8QTJa3q26RPa/82O5zQlzd1w/EjA4G6Vv8H6wvK0fHNwpU3hl9V8EL7Ca7JKfJr11Vw0fNHx2nXjOLURt27wbDeWUaSrzI+z2h/0TSiKWas/Eu5+4L9n7E3H5u5Hg2uaCQkDpy6RJkW9UL6lCC1YEJw5yHTugrPNoMcRlAKRoSIeSZSPfGl0CKYAC39s422xX2f46GpJu0bO8GG/XN9Qk+SxqPHGuzx7nWghFQctZb1ssGKuvHKqaNYZvWeWqqkxyPWb6xjaBaSGxcp5MsET+RAu2F1XgX9Is11mIJETlHhRE3OpMSHh7toIiuNs8YzsgkedVFWhx+Xu27DWvOFvg/01Rh6s5RGJKMgL7WQMLTtY2KI/ko648WXVoCtVymG8d30qWnSt8319jkILX/wdB8Vqp5ceRqHwDE89jhEh0GOg07eLcREnh+gjXij1/bS66/+hHk4jhkzGtbdfEji9sro4Nm+kVRA+6fgJjCvt1sAvjuj10Scx4uH3AdDTW+y0KaniK8EHTZzaGDuaV+tk3hZEfpwpdan5mquoQvFdZWsWlDefX7gRq38szmi9LtULEai0WKOtqnnDIOnWk/3NYeNdzJ28YzrUDbkxtghkRgr7fNGEtyCGRuWRRMc5mVp2FPzAwRKk29ShILpWbvfUzwAWUOEpyAS4bstzlMybf9L8sp20+Ier8gOMGJ81eXXXmhtgMn6aWZ6EDGe1Shl0gDM0JUEAkA2+kf3oIZAvcWiFxj7vyd4Aacw3RetUSJcy8JwbV3I/isxKyy/xs8zE2PUY0z3Cwh9MpVP9G8N6Mef6v2DNDNg+2iJ/eslQdbZRQzdJwnBMhpOopzRwuUaC7jJKyGBkcNbbmNjceJWEue0XVjIcZHJ7BFe3jKluezNIJIf268V35+HIpXJA7BUJn8NPCIQXze5Frm46U2aRTQ53LU4HBGLXYPzx8QLsn0jLVy518w/TztawdT3/SmSWNwYTuZG18TmXs9v3oB6PrUr4M7kJbNRLpRb0ZelbMDwpR074FPwwud6fkjR2lLQBbufmPUBdpVJZ2xFjijle8h1h29zoFsydFNq5wSXUO/nm/S09KdKi5F2S1uKP+NL80OVEeC+QXcBdTry07meVIhsBOh+9ajy1ExaMaPs2xjB5QvTgJA9kfJOAoUygjMC33FwdRw10eGP//IsiRm9EukF1o++MfZnAtcjhoOoy79TjlO8p8YVNwEhZ14Ik/kIizyQtr0gR+pVEIc6+1W29UOWNRXb+ZavXRDq0wvxigMagfcL+zIr4gctufTfubiOmVa85qVJB,iv:VogP+OQvlsYCSqlmffO+o99C0hJm63ZqLXVd2B0oom0=,tag:+se1QHW6xLMj/dZrbY0MKQ==,type:str]
wireguard_private_key: ENC[AES256_GCM,data:sCskwDhemU1y4M4A4R9KxwiL8q+FtxnUqg1omU7yS81H1bbSM804hNzmq+A=,iv:7wNMAG+7wYYXYgKEohIAYisMN5lbz+M5RhCEaHL4yWE=,tag:FENdJTEEGD9cEJVwIIUQDA==,type:str]
sops:
age:
- recipient: age1f6drjusg866yscj8029tk4yfpgecklrvezldm02ankm6h8nnwu5s2u6ahy
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBHS0F1R0NnV0gyNFlkUEhZ
UkxvN1ZLQTFsV0tnR0pLNFJycmduU1VXUlFVCjBkRGxQd1B1c3cweTRsZm9OUCt0
anU3RTFUUkxoaXlhdlR0RkxPclVUdVkKLS0tIG9kTEVNK2piRWI5ZWFSejFFUGtD
emtTUGk0cVZWR3F5R05WTTFJUFUwNTAKrRYQAJen6QVSgaOyqPxSIniHiMLUfXuv
/O1Ebz5xLWn99EhloqW7rHhUxXlhxP2CmwfYXizyKFa6nAu6R+BCgg==
-----END AGE ENCRYPTED FILE-----
- recipient: age1ykcs39e62pz3xu6cedg8ea685kv5d5qsrhgkndygzm8rx30xd5ys5t3qxt
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBXNWRXZTFWREIzRVhRaWRB
anNDb3hsZzFOMFMrclhmeldaOWY4b3BJekFBCkJhbjRvRUwva3lFbzNTKzJqK2p2
WVlMaXpvczlhdGduZHIrb2xPaEg3OUUKLS0tIHFtM09mN0FEUWdjWEVEL3VXL00w
WHpOY280S2hpVU1mNnozODRoMnB4bGMKK5RrDK2kAZlWf2igqyzWgshxLPj+f74A
mCmMLDHo5drNieFYp+guqHaHnZkf9IzpAglj7x6wCITjk+l6go5KvA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2026-03-27T03:59:09Z"
mac: ENC[AES256_GCM,data:MsPAxssWUSvsJQP0Ogrl3r/GoVqeL1L95YTJQbAJZ4FVxhRXP7KfbUnKSclzU6G8CP5WxV18TXZfB4JITKG3Lz5rtVpD/WFMdhDmve0f6BPMAimle2ajWUaWYNePvEynClX3nydLk3h31DjHGa8YvJZqW2ieDb/JDMdBXiLTrWc=,iv:82ul5CV3XXllFCDJfF6beIcAIFj71ycJJF4iEQvovMA=,tag:108L7VkAoPUTLtV74qgrrA==,type:str]
unencrypted_suffix: _unencrypted
version: 3.12.2
@@ -10,7 +10,6 @@ in
let let
flakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic"; flakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic";
certDir = "${config.mtls.certDir}"; certDir = "${config.mtls.certDir}";
CACert = "${certDir}/root_ca.crt";
mtlsBundle = "${certDir}/${config.mtls.bundleFilename}"; mtlsBundle = "${certDir}/${config.mtls.bundleFilename}";
resticPasswordFile = "${config.xdg.configHome}/restic/password.txt"; resticPasswordFile = "${config.xdg.configHome}/restic/password.txt";
in in
@@ -19,6 +18,7 @@ in
rebuild rebuild
john john
mysops mysops
janus-ca
step-ssh-user step-ssh-user
mtls mtls
restic restic
@@ -91,10 +91,6 @@ in
mtls = { mtls = {
enable = true; enable = true;
subject = hostname; subject = hostname;
ca = {
url = "https://janus.john-stream.com/";
fingerprint = "2036c44f7b5901566ff7611ea6c927291ecc6d2dd00779c0eead70ec77fa10d6";
};
san = [ san = [
"${hostname}" "${hostname}"
"192.168.1.85" "192.168.1.85"
+1 -5
View File
@@ -24,7 +24,6 @@ in
]; ];
step-ssh-host = { step-ssh-host = {
hostname = hostname; hostname = hostname;
caURL = caURL;
}; };
home-manager.users."${username}" = { home-manager.users."${username}" = {
@@ -40,6 +39,7 @@ in
imports = with inputs.self.modules; [ imports = with inputs.self.modules; [
homeManager.rebuild homeManager.rebuild
homeManager.mysops homeManager.mysops
homeManager.janus-ca
homeManager.mtls homeManager.mtls
homeManager.docker homeManager.docker
]; ];
@@ -56,10 +56,6 @@ in
mtls = { mtls = {
enable = true; enable = true;
subject = hostname; subject = hostname;
ca = {
url = "https://janus.john-stream.com/";
fingerprint = "2036c44f7b5901566ff7611ea6c927291ecc6d2dd00779c0eead70ec77fa10d6";
};
san = [ san = [
"${hostname}.john-stream.com" "${hostname}.john-stream.com"
"192.168.1.142" "192.168.1.142"
+11
View File
@@ -0,0 +1,11 @@
{ self, inputs, ... }: {
flake.modules.homeManager.brave = {
programs.brave = {
enable = true;
extensions = [
# https://chromewebstore.google.com/detail/1password-%E2%80%93-password-mana/aeblfdkhhhdcdjpifhhbdiojplfjncoa
"aeblfdkhhhdcdjpifhhbdiojplfjncoa"
];
};
};
}
-12
View File
@@ -1,12 +0,0 @@
# This module is for programs with GUIs that run in a desktop environment
{ inputs, ... }:
{
flake.modules.homeManager.desktop =
{
imports = with inputs.self.modules.homeManager; [
onepassword
ghostty
sublime
];
};
}
+8 -3
View File
@@ -1,6 +1,8 @@
{ { self, inputs, ... }: {
flake.modules.homeManager.git = { config, lib, ... }: flake.modules.homeManager.git = { config, pkgs, lib, ... }: {
{ home.packages = with pkgs; [
git-credential-oauth
];
programs.git = { programs.git = {
enable = true; enable = true;
settings = { settings = {
@@ -14,5 +16,8 @@
enableBashIntegration = true; enableBashIntegration = true;
enableZshIntegration = true; enableZshIntegration = true;
}; };
home.shellAliases = {
"lzg" = "lazygit";
};
}; };
} }
+33
View File
@@ -0,0 +1,33 @@
{ self, inputs, ... }: {
flake-file.inputs = {
wrapper-modules.url = "github:BirdeeHub/nix-wrapper-modules";
# wrapper-modules.inputs.nixpkgs.follows = "nixpkgs";
};
flake.modules.nixos.niri = { pkgs, lib, ... }: {
programs.niri = {
enable = true;
package = self.packages.${pkgs.stdenv.hostPlatform.system}.myNiri;
};
};
perSystem = { pkgs, lib, self', ... }: {
packages.myNiri = inputs.wrapper-modules.wrappers.niri.wrap {
inherit pkgs;
env.RUST_BACKTRACE = "full";
settings = {
spawn-at-startup = [
"${lib.getExe self'.packages.myNoctalia}"
];
xwayland-satellite.path = lib.getExe pkgs.xwayland-satellite;
input.keyboard.xkb.layout = "us,ua";
layout.gaps = 5;
binds = {
"Mod+Return".spawn-sh = lib.getExe pkgs.ghostty;
"Mod+Q".close-window = null;
"Mod+S".spawn-sh = "${lib.getExe self'.packages.myNoctalia} ipc call launcher toggle";
};
};
};
};
}
+8
View File
@@ -0,0 +1,8 @@
{ self, inputs, ... }: {
perSystem = { pkgs, ... }: {
packages.myNoctalia = inputs.wrapper-modules.wrappers.noctalia-shell.wrap {
inherit pkgs;
# settings = (builtins.fromJSON (builtins.readFile ./noctalia.json)).settings;
};
};
}
+14 -3
View File
@@ -1,5 +1,16 @@
{ { self, inputs, ... }: {
flake.modules.homeManager.onepassword = { flake.modules.homeManager.onepassword = { config, pkgs, lib, ... }: {
# TODO: Port `_1password = true` behavior into an explicit Home Manager module. home.file.".config/1Password/ssh/agent.toml".text = ''
# https://developer.1password.com/docs/ssh/agent/config
[[ssh-keys]]
vault = "Private"
'';
programs.ssh = {
enable = true;
extraConfig = ''
Host *
IdentityAgent ${config.home.homeDirectory}/.1password/agent.sock
'';
};
}; };
} }
+1 -1
View File
@@ -23,7 +23,6 @@
home.packages = with pkgs; [ home.packages = with pkgs; [
wget wget
curl curl
cacert
busybox busybox
gnugrep gnugrep
dig dig
@@ -31,6 +30,7 @@
uv uv
xclip xclip
jq jq
ripgrep
]; ];
}; };
}; };
+15
View File
@@ -0,0 +1,15 @@
{ self, inputs, ... }: {
flake.modules.nixos.steam = {
progams.gamemode.enable = true;
programs.steam = {
enable = true;
gamescopeSession.enable = true;
# Open ports in the firewall for Steam Remote Play
remotePlay.openFirewall = true;
# Open ports in the firewall for Source Dedicated Server
dedicatedServer.openFirewall = true;
# Open ports in the firewall for Steam Local Network Game Transfers
localNetworkGameTransfers.openFirewall = true;
};
};
}
+1 -33
View File
@@ -1,9 +1,4 @@
{ inputs, ... }: { self, inputs, ... }: {
let
caURL = "https://janus.john-stream.com/";
stepFingerprint = "2036c44f7b5901566ff7611ea6c927291ecc6d2dd00779c0eead70ec77fa10d6";
in
{
# #
# Home Manager Module # Home Manager Module
# #
@@ -17,42 +12,15 @@ in
{ {
options.step-ssh-user = { options.step-ssh-user = {
enable = lib.mkEnableOption "opionated step client config for SSH certs"; enable = lib.mkEnableOption "opionated step client config for SSH certs";
caURL = lib.mkOption {
type = lib.types.str;
default = "${caURL}";
};
fingerprint = lib.mkOption {
type = lib.types.str;
default = "${stepFingerprint}";
};
rootCertFile = {
path = lib.mkOption {
type = lib.types.str;
description = "String path to where the root_ca.crt file will be stored for the user";
default = ".step/certs/root_ca.crt";
};
source = lib.mkOption {
type = lib.types.path;
description = "Nix path to the root cert file within the repo";
default = ../../keys/root_ca.crt;
};
};
provisioner = lib.mkOption { provisioner = lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = "admin"; default = "admin";
}; };
principals = lib.mkOption { principals = lib.mkOption {
type = lib.types.listOf lib.types.str; type = lib.types.listOf lib.types.str;
# default = [ ];
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.file."${cfg.rootCertFile.path}".source = cfg.rootCertFile.source;
home.file.".step/config/defaults.json".text = builtins.toJSON {
"ca-url" = cfg.caURL;
fingerprint = cfg.fingerprint;
root = "${config.home.homeDirectory}/${cfg.rootCertFile.path}";
};
sops.secrets."janus/admin_jwk".mode = "0400"; sops.secrets."janus/admin_jwk".mode = "0400";
home.packages = with pkgs; [ home.packages = with pkgs; [
(writeShellScriptBin "sign-ssh-cert" '' (writeShellScriptBin "sign-ssh-cert" ''
-8
View File
@@ -1,8 +0,0 @@
{ inputs, pkgs, ... }:
{
flake.modules.homeManager.sublime = { pkgs, lib, ... }: {
home.packages = with pkgs; [
sublime4
];
};
}
+10
View File
@@ -0,0 +1,10 @@
{ self, inputs, ... }: {
flake.modules.nixos.sudo = {
security.sudo-rs = {
enable = true;
execWheelOnly = false;
wheelNeedsPassword = false;
extraConfig = "Defaults timestamp_timeout=1440";
};
};
}
+23 -18
View File
@@ -1,21 +1,26 @@
{ { self, inputs, ... }: {
flake.modules.homeManager.vscode = { pkgs, ... }: flake.modules.homeManager.vscode = { config, pkgs, lib, ... }: {
{ options.my-vscode = {
programs.vscode = { enable = lib.mkEnableOption "Enable nix-managed VSCode";
enable = true; };
package = pkgs.vscode;
profiles.default.extensions = with pkgs.vscode-extensions; [ config = lib.mkIf config.my-vscode.enable {
mhutchie.git-graph programs.vscode = {
ms-vscode-remote.vscode-remote-extensionpack enable = true;
ms-python.python package = pkgs.vscode;
ms-python.vscode-pylance profiles.default.extensions = with pkgs.vscode-extensions; [
ms-toolsai.jupyter mhutchie.git-graph
charliermarsh.ruff ms-vscode-remote.vscode-remote-extensionpack
github.vscode-pull-request-github ms-python.python
github.vscode-github-actions ms-python.vscode-pylance
github.copilot ms-toolsai.jupyter
catppuccin.catppuccin-vsc charliermarsh.ruff
]; github.vscode-pull-request-github
github.vscode-github-actions
github.copilot
catppuccin.catppuccin-vsc
];
};
}; };
}; };
} }
+58
View File
@@ -0,0 +1,58 @@
{ self, inputs, ... }: {
flake.modules.nixos.wireguard = { config, pkgs, lib, ... }:
let
wgInterface = "platform";
systemctl = lib.getExe' pkgs.systemd "systemctl";
journalctl = lib.getExe' pkgs.systemd "journalctl";
mkConnect = interface:
let
serviceName = "wg-quick-${interface}";
service = "${serviceName}.service";
in
pkgs.writeShellScriptBin "wg-connect-${interface}" ''
${systemctl} start ${service}
start_time=$(${systemctl} show -p ActiveEnterTimestamp ${serviceName} | cut -d= -f2)
${journalctl} -u ${service} --since "$start_time" --no-pager
'';
mkDisconnect = interface:
let
serviceName = "wg-quick-${interface}";
service = "${serviceName}.service";
in
pkgs.writeShellScriptBin "wg-disconnect-${interface}" ''
${systemctl} stop ${service}
start_time=$(${systemctl} show -p ActiveEnterTimestamp ${serviceName} | cut -d= -f2)
${journalctl} -u ${service} --since "$start_time" --no-pager
'';
in
{
imports = [ inputs.sops-nix.nixosModules.sops ];
environment.systemPackages = with pkgs; [
wireguard-tools
wg-netmanager
(mkConnect "platform")
(mkDisconnect "platform")
];
sops.secrets.wireguard_private_key = { };
networking.wg-quick.interfaces = {
${wgInterface} = {
autostart = false; # Managed by dispatcher
postUp = "echo 'Post up command'";
address = [ "192.168.3.5/32" ];
dns = [ "192.168.1.150" ];
privateKeyFile = config.sops.secrets.wireguard_private_key.path;
peers = [
{
publicKey = "BD1/q18OfpoMCDusNZk9cqB1vvR8bgodZ1L7198jVic=";
allowedIPs = [ "192.168.0.0/16" ];
endpoint = "wg.john-stream.com:51830";
persistentKeepalive = 25;
}
];
};
};
};
}
@@ -103,7 +103,6 @@
]; ];
}; };
}; };
}; };
}; };
} }
+8 -22
View File
@@ -3,14 +3,6 @@ let
# Options that will be in common between # Options that will be in common between
opts = { opts = {
enable = lib.mkEnableOption "Enable mTLS"; enable = lib.mkEnableOption "Enable mTLS";
ca = {
url = lib.mkOption {
type = lib.types.str;
};
fingerprint = lib.mkOption {
type = lib.types.str;
};
};
subject = lib.mkOption { subject = lib.mkOption {
description = "The Common Name, DNS Name, or IP address that will be set as the Subject Common Name for the certificate. If no Subject Alternative Names (SANs) are configured (via the --san flag) then the subject will be set as the only SAN."; description = "The Common Name, DNS Name, or IP address that will be set as the Subject Common Name for the certificate. If no Subject Alternative Names (SANs) are configured (via the --san flag) then the subject will be set as the only SAN.";
type = lib.types.str; type = lib.types.str;
@@ -92,9 +84,12 @@ let
systemctlArgs ? [ ], systemctlArgs ? [ ],
}: }:
let let
systemctl = lib.getExe' pkgs.systemd "systemctl";
escapedArgs = lib.escapeShellArgs systemctlArgs;
systemctlCommand = "${systemctl} ${escapedArgs}";
renewReloadScript = lib.concatMapStringsSep "\n" (unit: '' renewReloadScript = lib.concatMapStringsSep "\n" (unit: ''
if ${lib.getExe' pkgs.systemd "systemctl"} ${lib.escapeShellArgs systemctlArgs} --quiet is-active "${unit}"; then if ${systemctlCommand} --quiet is-active "${unit}"; then
${lib.getExe' pkgs.systemd "systemctl"} ${lib.escapeShellArgs systemctlArgs} try-reload-or-restart "${unit}" ${systemctlCommand} try-reload-or-restart "${unit}"
fi fi
'') reloadUnits; '') reloadUnits;
renewPostCommands = lib.concatStringsSep "\n" postCommands; renewPostCommands = lib.concatStringsSep "\n" postCommands;
@@ -221,7 +216,6 @@ in
tlsKey = "${certDir}/${cfg.keyFilename}"; tlsKey = "${certDir}/${cfg.keyFilename}";
tlsCert = "${certDir}/${cfg.certFilename}"; tlsCert = "${certDir}/${cfg.certFilename}";
mtlsBundle = "${certDir}/${cfg.bundleFilename}"; mtlsBundle = "${certDir}/${cfg.bundleFilename}";
rootCA = "${certDir}/root_ca.crt";
sanArgs = lib.concatMapStringsSep " " (san: "--san \"${san}\"") cfg.san; sanArgs = lib.concatMapStringsSep " " (san: "--san \"${san}\"") cfg.san;
in in
{ {
@@ -260,11 +254,9 @@ in
flake.modules.homeManager.mtls = { config, lib, pkgs, ... }: flake.modules.homeManager.mtls = { config, lib, pkgs, ... }:
let let
cfg = config.mtls; cfg = config.mtls;
certDir = cfg.certDir; tlsKey = "${cfg.certDir}/${cfg.keyFilename}";
tlsKey = "${certDir}/${cfg.keyFilename}"; tlsCert = "${cfg.certDir}/${cfg.certFilename}";
tlsCert = "${certDir}/${cfg.certFilename}"; mtlsBundle = "${cfg.certDir}/${cfg.bundleFilename}";
mtlsBundle = "${certDir}/${cfg.bundleFilename}";
rootCA = "${certDir}/root_ca.crt";
sanArgs = lib.concatMapStringsSep " " (san: "--san \"${san}\"") cfg.san; sanArgs = lib.concatMapStringsSep " " (san: "--san \"${san}\"") cfg.san;
in in
{ {
@@ -277,12 +269,6 @@ in
}; };
config = { config = {
home.file.".step/config/defaults.json".text = builtins.toJSON {
"ca-url" = cfg.ca.url;
fingerprint = cfg.ca.fingerprint;
root = "${cfg.certDir}/root_ca.crt";
};
home.packages = with pkgs; lib.optionals cfg.enable [ home.packages = with pkgs; lib.optionals cfg.enable [
step-cli step-cli
(writeShellScriptBin "mtls-generate" '' (writeShellScriptBin "mtls-generate" ''
+2 -22
View File
@@ -2,7 +2,6 @@
flake.modules.nixos.step-ssh-host = { config, pkgs, lib, ... }: flake.modules.nixos.step-ssh-host = { config, pkgs, lib, ... }:
let let
cfg = config.step-ssh-host; cfg = config.step-ssh-host;
rootCertPath = "/etc/step/certs/root_ca.crt";
provisionerPasswordPath = config.sops.secrets."janus/admin_jwk".path; provisionerPasswordPath = config.sops.secrets."janus/admin_jwk".path;
sshKeyPath = "/etc/ssh/ssh_host_ed25519_key"; sshKeyPath = "/etc/ssh/ssh_host_ed25519_key";
sshCertPath = "${sshKeyPath}-cert.pub"; sshCertPath = "${sshKeyPath}-cert.pub";
@@ -11,25 +10,9 @@
# NixOS Options # NixOS Options
options.step-ssh-host = { options.step-ssh-host = {
hostname = lib.mkOption { hostname = lib.mkOption {
description = "Networking host name"; description = "Networking host name to register with the CA";
type = lib.types.str; type = lib.types.str;
}; };
caURL = lib.mkOption {
description = "URL for the certificate authority";
type = lib.types.str;
};
rootCertFile = {
path = lib.mkOption {
description = "String path to where the root_ca.crt file will be stored for the user";
type = lib.types.str;
default = "step/certs/root_ca.crt";
};
source = lib.mkOption {
description = "Nix path to the root cert file within the repo";
type = lib.types.path;
default = ../../../keys/root_ca.crt;
};
};
provisioner = lib.mkOption { provisioner = lib.mkOption {
description = "Provisioner inside Step CA to use for the SSH certificates"; description = "Provisioner inside Step CA to use for the SSH certificates";
type = lib.types.str; type = lib.types.str;
@@ -38,6 +21,7 @@
}; };
imports = with inputs.self.modules.nixos; [ ssh ]; imports = with inputs.self.modules.nixos; [ ssh ];
# NixOS Config # NixOS Config
config = { config = {
ssh.certificates.enable = true; ssh.certificates.enable = true;
@@ -48,15 +32,11 @@
}; };
networking.nameservers = [ "192.168.1.150" ]; networking.nameservers = [ "192.168.1.150" ];
networking.dhcpcd.extraConfig = "nohook resolv.conf"; networking.dhcpcd.extraConfig = "nohook resolv.conf";
environment.etc."${cfg.rootCertFile.path}".source = cfg.rootCertFile.source;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
step-cli step-cli
(writeShellScriptBin "ssh-host-cert-renew" '' (writeShellScriptBin "ssh-host-cert-renew" ''
${lib.getExe pkgs.step-cli} ssh certificate \ ${lib.getExe pkgs.step-cli} ssh certificate \
--host --sign \ --host --sign \
--root "${rootCertPath}" \
--ca-url ${cfg.caURL} \
--provisioner "${cfg.provisioner}" \ --provisioner "${cfg.provisioner}" \
--provisioner-password-file "${provisionerPasswordPath}" \ --provisioner-password-file "${provisionerPasswordPath}" \
--principal "${cfg.hostname}" \ --principal "${cfg.hostname}" \
+1
View File
@@ -20,6 +20,7 @@ in
modules = { modules = {
nixos."${username}" = { nixos."${username}" = {
imports = [ imports = [
inputs.home-manager.nixosModules.home-manager
(inputs.self.factory.user username true).nixos."${username}" (inputs.self.factory.user username true).nixos."${username}"
]; ];
users.users."${username}" = { users.users."${username}" = {
-50
View File
@@ -1,50 +0,0 @@
{
base = {
repository = "local:/mnt/backup";
password-file = "{{ .ConfigDir }}/password.txt";
status-file = "{{ .ConfigDir }}/backup-status.json";
retention = {
after-backup = true;
keep-last = "10";
keep-hourly = "8";
keep-daily = "14";
keep-weekly = "8";
};
backup = {
verbose = true;
exclude = [
".cache"
".devenv"
".rustup"
".cargo"
".venv"
".pyenv"
".vscode*"
"data/postgres"
"build"
"__pycache__"
"*.log"
"*.egg-info"
"*.csv"
"*.m4a"
".local/share/Steam"
".local/share/Trash"
"build"
"dist"
"/home/*/Pictures"
"/home/*/Videos"
"/home/*/go"
"/home/*/snap"
"/home/john/john-nas"
];
schedule-permission = "user";
schedule-priority = "background";
check-after = true;
};
prune = {
schedule-permission = "user";
schedule-lock-wait = "1h";
};
};
}