Compare commits
28 Commits
main
...
429d1b7f11
| Author | SHA1 | Date | |
|---|---|---|---|
| 429d1b7f11 | |||
| 942cc13cf0 | |||
| f1e395fd30 | |||
| 0ebd91234e | |||
| 4a235fe1e1 | |||
| 4465fd0f90 | |||
| 9c733a135a | |||
| 193e5ee40d | |||
| 71a04c627a | |||
| 338ef34212 | |||
| 1f5319252e | |||
| 29853f4a35 | |||
| 9f2a55cfd6 | |||
| 1d8e721171 | |||
| 731277aad8 | |||
| bab4dfa131 | |||
| 2c8e7e3b63 | |||
| 2ca7dcc464 | |||
| 8b4a2a36b6 | |||
| fae745af5a | |||
| 0d39ac7ca2 | |||
| 5bbf20aabd | |||
| 3da3cc2dc6 | |||
| 18b6cc16ad | |||
| d8ced840ca | |||
| 2fad88f8a0 | |||
| 7b0f419454 | |||
| f8c09878a1 |
Generated
+33
-48
@@ -53,24 +53,6 @@
|
||||
"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": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
@@ -125,6 +107,22 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-hardware": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1774465523,
|
||||
"narHash": "sha256-4v7HPm63Q90nNn4fgkgKsjW1AH2Klw7XzPtHJr562nM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "de895be946ad1d8aafa0bb6dfc7e7e0e9e466a29",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "nixos-hardware",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1773389992,
|
||||
@@ -156,16 +154,18 @@
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1682134069,
|
||||
"narHash": "sha256-TnI/ZXSmRxQDt2sjRYK/8j8iha4B4zP2cnQCZZ3vp7k=",
|
||||
"lastModified": 1773840656,
|
||||
"narHash": "sha256-9tpvMGFteZnd3gRQZFlRCohVpqooygFuy9yjuyRL2C0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "fd901ef4bf93499374c5af385b2943f5801c0833",
|
||||
"rev": "9cf7092bdd603554bd8b63c216e8943cf9b12512",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
@@ -175,12 +175,13 @@
|
||||
"home-manager": "home-manager",
|
||||
"import-tree": "import-tree",
|
||||
"nixgl": "nixgl",
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixpkgs-lib": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"sops-nix": "sops-nix",
|
||||
"vscode-server": "vscode-server"
|
||||
"wrapper-modules": "wrapper-modules"
|
||||
}
|
||||
},
|
||||
"sops-nix": {
|
||||
@@ -218,37 +219,21 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"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": {
|
||||
"wrapper-modules": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_2",
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1770124655,
|
||||
"narHash": "sha256-yHmd2B13EtBUPLJ+x0EaBwNkQr9LTne1arLVxT6hSnY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-vscode-server",
|
||||
"rev": "92ce71c3ba5a94f854e02d57b14af4997ab54ef0",
|
||||
"lastModified": 1774400689,
|
||||
"narHash": "sha256-hHABVYL0rxhVIzc7hZEpvE0eiCKPnevte73Tn6FRolo=",
|
||||
"owner": "BirdeeHub",
|
||||
"repo": "nix-wrapper-modules",
|
||||
"rev": "54645978682ff99594a1d1666dde6fac6a8134f2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-vscode-server",
|
||||
"owner": "BirdeeHub",
|
||||
"repo": "nix-wrapper-modules",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,30 @@
|
||||
# DO-NOT-EDIT. This file was auto-generated using github:vic/flake-file.
|
||||
# Use `nix run .#write-flake` to regenerate it.
|
||||
{
|
||||
|
||||
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules);
|
||||
|
||||
inputs = {
|
||||
flake-file.url = "github:vic/flake-file";
|
||||
flake-parts = {
|
||||
inputs.nixpkgs-lib.follows = "nixpkgs-lib";
|
||||
url = "github:hercules-ci/flake-parts";
|
||||
inputs.nixpkgs-lib.follows = "nixpkgs-lib";
|
||||
};
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
import-tree.url = "github:vic/import-tree";
|
||||
nixgl = {
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
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-lib.follows = "nixpkgs";
|
||||
sops-nix = {
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
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";
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# This module is for programs with GUIs that run in a desktop environment
|
||||
{ inputs, ... }:
|
||||
{
|
||||
flake.modules.homeManager.desktop = { pkgs, ... }: {
|
||||
imports = with inputs.self.modules.homeManager; [
|
||||
brave
|
||||
ghostty
|
||||
onepassword
|
||||
];
|
||||
home.packages = with pkgs; [
|
||||
mangohud
|
||||
sublime4
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
{ 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 = { pkgs, ... }: {
|
||||
dconf.settings = {
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = "prefer-dark";
|
||||
};
|
||||
"org/gnome/shell" = {
|
||||
disable-user-extensions = false;
|
||||
|
||||
# `gnome-extensions list` for a list
|
||||
enabled-extensions = with pkgs.gnomeExtensions; [
|
||||
appindicator.extensionUuid
|
||||
gtile.extensionUuid
|
||||
space-bar.extensionUuid
|
||||
switcher.extensionUuid
|
||||
tactile.extensionUuid
|
||||
vitals.extensionUuid
|
||||
dash-to-panel.extensionUuid
|
||||
];
|
||||
};
|
||||
"org/gnome/desktop/wm/preferences" = {
|
||||
button-layout = ":minimize,close";
|
||||
};
|
||||
};
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme = {
|
||||
name = "Orchis-Dark";
|
||||
package = pkgs.orchis-theme;
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
gnome-tweaks
|
||||
gnomeExtensions.appindicator # For gnome systray icons
|
||||
gnomeExtensions.dash-to-panel
|
||||
gnomeExtensions.gtile
|
||||
gnomeExtensions.space-bar
|
||||
gnomeExtensions.switcher
|
||||
gnomeExtensions.tactile
|
||||
gnomeExtensions.vitals
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -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
|
||||
username = "john";
|
||||
hostname = "janus";
|
||||
caURL = "https://janus.john-stream.com/";
|
||||
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 {
|
||||
modules = with inputs.self.modules; [
|
||||
nixos.lxc
|
||||
@@ -20,12 +28,10 @@ in
|
||||
networking.hostName = hostname;
|
||||
step-ssh-host = {
|
||||
hostname = hostname;
|
||||
caURL = caURL;
|
||||
};
|
||||
mtls = {
|
||||
enable = true;
|
||||
subject = hostname;
|
||||
caURL = caURL;
|
||||
san = [
|
||||
"${hostname}.john-stream.com"
|
||||
"192.168.1.244"
|
||||
@@ -36,18 +42,10 @@ in
|
||||
imports = with inputs.self.modules.homeManager; [
|
||||
sops
|
||||
step-ssh-user
|
||||
janus-ca
|
||||
];
|
||||
|
||||
shell.program = "zsh";
|
||||
docker.enable = true;
|
||||
# step-ssh-user = {
|
||||
# enable = true;
|
||||
# principals = [ "${hostname}" ];
|
||||
# };
|
||||
ssh.matchSets = {
|
||||
certs = true;
|
||||
homelab = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
@@ -0,0 +1,130 @@
|
||||
{ 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 = {
|
||||
allowUnfree = true;
|
||||
permittedInsecurePackages = [ "openssl-1.1.1w" ];
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = hostname;
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
|
||||
# Enable automatic login for the user.
|
||||
services.displayManager.autoLogin.enable = true;
|
||||
services.displayManager.autoLogin.user = "john";
|
||||
|
||||
# Define a user account. Don't forget to set a password with 'passwd'.
|
||||
users.users.john = {
|
||||
isNormalUser = true;
|
||||
description = "John Lancaster";
|
||||
extraGroups = [
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
];
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
gamescopeSession.enable = true;
|
||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
||||
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
||||
};
|
||||
|
||||
# progams.gamemode.enable = true;
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# programs.mtr.enable = true;
|
||||
# programs.gnupg.agent = {
|
||||
# enable = true;
|
||||
# enableSSHSupport = 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{ 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"
|
||||
self.modules.nixos.p14sConfiguration
|
||||
self.modules.nixos.gnome
|
||||
# self.modules.nixos.greetd
|
||||
# self.modules.nixos.niri
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
{ self, inputs, ... }: {
|
||||
flake.modules.nixos.p14sHardware = { config, lib, pkgs, modulesPath, ... }: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
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;
|
||||
};
|
||||
}
|
||||
@@ -10,7 +10,6 @@ in
|
||||
let
|
||||
flakeDir = "${config.xdg.configHome}/home-manager/jsl-dendritic";
|
||||
certDir = "${config.mtls.certDir}";
|
||||
CACert = "${certDir}/root_ca.crt";
|
||||
mtlsBundle = "${certDir}/${config.mtls.bundleFilename}";
|
||||
resticPasswordFile = "${config.xdg.configHome}/restic/password.txt";
|
||||
in
|
||||
@@ -19,6 +18,7 @@ in
|
||||
rebuild
|
||||
john
|
||||
mysops
|
||||
janus-ca
|
||||
step-ssh-user
|
||||
mtls
|
||||
restic
|
||||
@@ -91,10 +91,6 @@ in
|
||||
mtls = {
|
||||
enable = true;
|
||||
subject = hostname;
|
||||
ca = {
|
||||
url = "https://janus.john-stream.com/";
|
||||
fingerprint = "2036c44f7b5901566ff7611ea6c927291ecc6d2dd00779c0eead70ec77fa10d6";
|
||||
};
|
||||
san = [
|
||||
"${hostname}"
|
||||
"192.168.1.85"
|
||||
@@ -24,7 +24,6 @@ in
|
||||
];
|
||||
step-ssh-host = {
|
||||
hostname = hostname;
|
||||
caURL = caURL;
|
||||
};
|
||||
|
||||
home-manager.users."${username}" = {
|
||||
@@ -40,6 +39,7 @@ in
|
||||
imports = with inputs.self.modules; [
|
||||
homeManager.rebuild
|
||||
homeManager.mysops
|
||||
homeManager.janus-ca
|
||||
homeManager.mtls
|
||||
homeManager.docker
|
||||
];
|
||||
@@ -56,10 +56,6 @@ in
|
||||
mtls = {
|
||||
enable = true;
|
||||
subject = hostname;
|
||||
ca = {
|
||||
url = "https://janus.john-stream.com/";
|
||||
fingerprint = "2036c44f7b5901566ff7611ea6c927291ecc6d2dd00779c0eead70ec77fa10d6";
|
||||
};
|
||||
san = [
|
||||
"${hostname}.john-stream.com"
|
||||
"192.168.1.142"
|
||||
|
||||
@@ -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"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{ self, inputs, ... }: {
|
||||
flake-file.inputs = {
|
||||
wrapper-modules.url = "github:BirdeeHub/nix-wrapper-modules";
|
||||
wrapper-modules.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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,25 @@
|
||||
{
|
||||
flake.modules.homeManager.onepassword = {
|
||||
# TODO: Port `_1password = true` behavior into an explicit Home Manager module.
|
||||
flake.modules.homeManager.onepassword = { config, pkgs, lib, ... }: {
|
||||
programs._1password-shell-plugins = {
|
||||
# enable 1Password shell plugins for bash, zsh, and fish shell
|
||||
enable = true;
|
||||
# the specified packages as well as 1Password CLI will be
|
||||
# automatically installed and configured to use shell plugins
|
||||
# https://developer.1password.com/docs/cli/shell-plugins
|
||||
plugins = with pkgs; [ gh ];
|
||||
};
|
||||
|
||||
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
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -23,7 +23,6 @@
|
||||
home.packages = with pkgs; [
|
||||
wget
|
||||
curl
|
||||
cacert
|
||||
busybox
|
||||
gnugrep
|
||||
dig
|
||||
@@ -31,6 +30,7 @@
|
||||
uv
|
||||
xclip
|
||||
jq
|
||||
ripgrep
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
{ inputs, ... }:
|
||||
let
|
||||
caURL = "https://janus.john-stream.com/";
|
||||
stepFingerprint = "2036c44f7b5901566ff7611ea6c927291ecc6d2dd00779c0eead70ec77fa10d6";
|
||||
in
|
||||
{
|
||||
{ self, inputs, ... }: {
|
||||
#
|
||||
# Home Manager Module
|
||||
#
|
||||
@@ -17,42 +12,15 @@ in
|
||||
{
|
||||
options.step-ssh-user = {
|
||||
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 {
|
||||
type = lib.types.str;
|
||||
default = "admin";
|
||||
};
|
||||
principals = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
# default = [ ];
|
||||
};
|
||||
};
|
||||
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";
|
||||
home.packages = with pkgs; [
|
||||
(writeShellScriptBin "sign-ssh-cert" ''
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
{ inputs, pkgs, ... }:
|
||||
{
|
||||
flake.modules.homeManager.sublime = { pkgs, lib, ... }: {
|
||||
home.packages = with pkgs; [
|
||||
sublime4
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -103,7 +103,6 @@
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -3,14 +3,6 @@ let
|
||||
# Options that will be in common between
|
||||
opts = {
|
||||
enable = lib.mkEnableOption "Enable mTLS";
|
||||
ca = {
|
||||
url = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
fingerprint = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
};
|
||||
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.";
|
||||
type = lib.types.str;
|
||||
@@ -92,9 +84,12 @@ let
|
||||
systemctlArgs ? [ ],
|
||||
}:
|
||||
let
|
||||
systemctl = lib.getExe' pkgs.systemd "systemctl";
|
||||
escapedArgs = lib.escapeShellArgs systemctlArgs;
|
||||
systemctlCommand = "${systemctl} ${escapedArgs}";
|
||||
renewReloadScript = lib.concatMapStringsSep "\n" (unit: ''
|
||||
if ${lib.getExe' pkgs.systemd "systemctl"} ${lib.escapeShellArgs systemctlArgs} --quiet is-active "${unit}"; then
|
||||
${lib.getExe' pkgs.systemd "systemctl"} ${lib.escapeShellArgs systemctlArgs} try-reload-or-restart "${unit}"
|
||||
if ${systemctlCommand} --quiet is-active "${unit}"; then
|
||||
${systemctlCommand} try-reload-or-restart "${unit}"
|
||||
fi
|
||||
'') reloadUnits;
|
||||
renewPostCommands = lib.concatStringsSep "\n" postCommands;
|
||||
@@ -221,7 +216,6 @@ in
|
||||
tlsKey = "${certDir}/${cfg.keyFilename}";
|
||||
tlsCert = "${certDir}/${cfg.certFilename}";
|
||||
mtlsBundle = "${certDir}/${cfg.bundleFilename}";
|
||||
rootCA = "${certDir}/root_ca.crt";
|
||||
sanArgs = lib.concatMapStringsSep " " (san: "--san \"${san}\"") cfg.san;
|
||||
in
|
||||
{
|
||||
@@ -260,11 +254,9 @@ in
|
||||
flake.modules.homeManager.mtls = { config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.mtls;
|
||||
certDir = cfg.certDir;
|
||||
tlsKey = "${certDir}/${cfg.keyFilename}";
|
||||
tlsCert = "${certDir}/${cfg.certFilename}";
|
||||
mtlsBundle = "${certDir}/${cfg.bundleFilename}";
|
||||
rootCA = "${certDir}/root_ca.crt";
|
||||
tlsKey = "${cfg.certDir}/${cfg.keyFilename}";
|
||||
tlsCert = "${cfg.certDir}/${cfg.certFilename}";
|
||||
mtlsBundle = "${cfg.certDir}/${cfg.bundleFilename}";
|
||||
sanArgs = lib.concatMapStringsSep " " (san: "--san \"${san}\"") cfg.san;
|
||||
in
|
||||
{
|
||||
@@ -277,12 +269,6 @@ in
|
||||
};
|
||||
|
||||
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 [
|
||||
step-cli
|
||||
(writeShellScriptBin "mtls-generate" ''
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
flake.modules.nixos.step-ssh-host = { config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.step-ssh-host;
|
||||
rootCertPath = "/etc/step/certs/root_ca.crt";
|
||||
provisionerPasswordPath = config.sops.secrets."janus/admin_jwk".path;
|
||||
sshKeyPath = "/etc/ssh/ssh_host_ed25519_key";
|
||||
sshCertPath = "${sshKeyPath}-cert.pub";
|
||||
@@ -11,25 +10,9 @@
|
||||
# NixOS Options
|
||||
options.step-ssh-host = {
|
||||
hostname = lib.mkOption {
|
||||
description = "Networking host name";
|
||||
description = "Networking host name to register with the CA";
|
||||
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 {
|
||||
description = "Provisioner inside Step CA to use for the SSH certificates";
|
||||
type = lib.types.str;
|
||||
@@ -38,6 +21,7 @@
|
||||
};
|
||||
|
||||
imports = with inputs.self.modules.nixos; [ ssh ];
|
||||
|
||||
# NixOS Config
|
||||
config = {
|
||||
ssh.certificates.enable = true;
|
||||
@@ -48,15 +32,11 @@
|
||||
};
|
||||
networking.nameservers = [ "192.168.1.150" ];
|
||||
networking.dhcpcd.extraConfig = "nohook resolv.conf";
|
||||
|
||||
environment.etc."${cfg.rootCertFile.path}".source = cfg.rootCertFile.source;
|
||||
environment.systemPackages = with pkgs; [
|
||||
step-cli
|
||||
(writeShellScriptBin "ssh-host-cert-renew" ''
|
||||
${lib.getExe pkgs.step-cli} ssh certificate \
|
||||
--host --sign \
|
||||
--root "${rootCertPath}" \
|
||||
--ca-url ${cfg.caURL} \
|
||||
--provisioner "${cfg.provisioner}" \
|
||||
--provisioner-password-file "${provisionerPasswordPath}" \
|
||||
--principal "${cfg.hostname}" \
|
||||
|
||||
@@ -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";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user