Merge branch 'main' of gh:greg-hellings/nixos-config

This commit is contained in:
Greg Hellings
2024-10-29 18:13:44 +00:00
142 changed files with 7017 additions and 5331 deletions
+122
View File
@@ -0,0 +1,122 @@
# EditorConfig configuration for nixpkgs
# https://EditorConfig.org
# Top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file, utf-8 charset
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
# Ignore diffs/patches
[*.{diff,patch}]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
# We want readFile .version to return the version without a newline.
[.version]
insert_final_newline = false
# see https://nixos.org/nixpkgs/manual/#chap-conventions
# Match json/lockfiles/markdown/nix/perl/python/ruby/shell/docbook files, set indent to spaces
[*.{json,lock,md,nix,pl,pm,py,rb,sh,xml}]
indent_style = space
# Match docbook files, set indent width of one
[*.xml]
indent_size = 1
# Match json/lockfiles/markdown/nix/ruby files, set indent width of two
[*.{json,lock,md,nix,rb}]
indent_size = 2
# Match perl/python/shell scripts, set indent width of four
[*.{pl,pm,py,sh}]
indent_size = 4
# Match gemfiles, set indent to spaces with width of two
[Gemfile]
indent_size = 2
indent_style = space
# Match package.json, which are generally pulled from upstream and accept them as they are
[package.json]
indent_style = unset
# Disable file types or individual files
# some of these files may be auto-generated and/or require significant changes
[*.{c,h}]
insert_final_newline = unset
trim_trailing_whitespace = unset
[*.{asc,key,ovpn}]
insert_final_newline = unset
end_of_line = unset
trim_trailing_whitespace = unset
[*.lock]
indent_size = unset
# Although Markdown/CommonMark allows using two trailing spaces to denote
# a hard line break, we do not use that feature in nixpkgs since
# it forces the surrounding paragraph to become a <literallayout> which
# does not wrap reasonably.
# Instead of a hard line break, start a new paragraph by inserting a blank line.
[*.md]
trim_trailing_whitespace = true
# binaries
[*.nib]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
charset = unset
[eggs.nix]
trim_trailing_whitespace = unset
[nixos/modules/services/networking/ircd-hybrid/*.{conf,in}]
trim_trailing_whitespace = unset
[pkgs/build-support/dotnetenv/Wrapper/**]
end_of_line = unset
indent_style = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
[pkgs/development/compilers/elm/registry.dat]
end_of_line = unset
insert_final_newline = unset
[pkgs/development/haskell-modules/hackage-packages.nix]
indent_style = unset
trim_trailing_whitespace = unset
[pkgs/misc/documentation-highlighter/**]
insert_final_newline = unset
[pkgs/servers/dict/wordnet_structures.py]
trim_trailing_whitespace = unset
[pkgs/tools/misc/timidity/timidity.cfg]
trim_trailing_whitespace = unset
[pkgs/tools/virtualization/ovftool/*.ova]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
charset = unset
[lib/tests/*.plist]
indent_style = tab
insert_final_newline = unset
[pkgs/kde/generated/**]
insert_final_newline = unset
end_of_line = unset
+1
View File
@@ -0,0 +1 @@
use flake
+2
View File
@@ -1,2 +1,4 @@
host host
result result
.pre-commit-config.yaml
.direnv
+25 -19
View File
@@ -1,21 +1,27 @@
{ {
fsid = "749bf0ea-acf5-4a5e-b33e-9a057455c06b"; fsid = "749bf0ea-acf5-4a5e-b33e-9a057455c06b";
clusterName = "home"; clusterName = "home";
initialMonitors = [ { initialMonitors = [
hostname = "myself.thehellings.lan"; {
ipAddress = "10.42.1.6"; hostname = "myself.thehellings.lan";
} { ipAddress = "10.42.1.6";
hostname = "jeremiah.thehellings.lan"; }
ipAddress = "10.42.1.8"; {
} { hostname = "jeremiah.thehellings.lan";
hostname = "hosea.thehellings.lan"; ipAddress = "10.42.1.8";
ipAddress = "10.42.1.7"; }
} ]; {
mdsNodes = [ { hostname = "hosea.thehellings.lan";
hostname = "jeremiah.thehellings.lan"; ipAddress = "10.42.1.7";
ipAddress = "10.42.1.8"; }
} ]; ];
publicNetworks = [ "10.42.0.0/16" ]; mdsNodes = [
clusterNetworks = [ "10.201.0.0/16" ]; {
adminKeyring = ../secrets/home.client.admin.keyring; hostname = "jeremiah.thehellings.lan";
ipAddress = "10.42.1.8";
}
];
publicNetworks = [ "10.42.0.0/16" ];
clusterNetworks = [ "10.201.0.0/16" ];
adminKeyring = ../secrets/home.client.admin.keyring;
} }
+14
View File
@@ -0,0 +1,14 @@
{ hooks, system, ... }:
{
pre-commit-check = hooks.lib.${system}.run {
src = ./.;
hooks = {
deadnix.enable = true;
# Needs https://github.com/DeterminateSystems/flake-checker/pull/130
#flake-checker.enable = true;
nixfmt-rfc-style.enable = true;
check-merge-conflicts.enable = true;
};
};
}
+10 -7
View File
@@ -5,11 +5,11 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = imports = [
[ # Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./modules/ ./modules
]; ];
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
@@ -72,10 +72,13 @@
users.users.greg = { users.users.greg = {
isNormalUser = true; isNormalUser = true;
description = "Greg Hellings"; description = "Greg Hellings";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [
"networkmanager"
"wheel"
];
packages = with pkgs; [ packages = with pkgs; [
firefox firefox
# thunderbird # thunderbird
]; ];
}; };
+4 -4
View File
@@ -1,8 +1,8 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
./modules ./modules
./hosts/work ./hosts/work
]; ];
} }
+34 -31
View File
@@ -1,33 +1,36 @@
{ inputs, overlays, ... }: { top, overlays, ... }:
let let
mac = { mac =
system ? "aarch64-darwin", {
name, system ? "aarch64-darwin",
channel ? inputs.nixunstable, name,
hm ? inputs.hmunstable, channel ? top.nixunstable,
extraMods ? [] hm ? top.hmunstable,
}: extraMods ? [ ],
let }:
nixpkgs = import channel { let
inherit system overlays; nixpkgs = import channel { inherit system overlays; };
}; in
in inputs.darwin.lib.darwinSystem { top.darwin.lib.darwinSystem {
inherit system; inherit system;
specialArgs = { inherit nixpkgs; }; specialArgs = {
modules = [ inherit nixpkgs;
{ };
nixpkgs.overlays = overlays; modules = [
home-manager.extraSpecialArgs = { {
inherit inputs; nixpkgs.overlays = overlays;
host = name; home-manager.extraSpecialArgs = {
}; inherit top;
} host = name;
hm.darwinModules.home-manager };
inputs.self.modules.darwinModule }
./${name} hm.darwinModules.home-manager
] ++ extraMods; top.self.modules.darwinModule
}; ./${name}
in rec { ] ++ extraMods;
la23002 = mac { name = "ivr"; }; };
LA23002 = la23002; in
rec {
la23002 = mac { name = "ivr"; };
LA23002 = la23002;
} }
-41
View File
@@ -1,41 +0,0 @@
{ pkgs, ... }:
let
qemu_conf = pkgs.stdenv.mkDerivation {
name = "qemu_conf";
phases = [ "installPhase" ];
cfg = pkgs.writeText "qemu.conf"
''
security_driver = "none"
dynamic_ownership = 0
remember_owner = 0
'';
installPhase = ''
mkdir -p $out/opt/homebrew/etc/libvirt/
cp $cfg $out/opt/homebrew/etc/libvirt/qemu.conf
'';
};
in {
environment.systemPackages = with pkgs; [
qemu_conf
unixtools.watch
];
homebrew = {
enable = true;
brews = [
"qemu"
"gcc"
"libaacs"
{
name = "libvirt";
restart_service = true;
}
"virt-manager"
];
casks = [
"synology-drive"
"handbrake"
];
};
}
Generated
+499 -104
View File
@@ -23,6 +23,43 @@
"type": "github" "type": "github"
} }
}, },
"btc": {
"inputs": {
"extra-container": "extra-container",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
},
"locked": {
"lastModified": 1723533469,
"narHash": "sha256-8gSsZpYmOzwFRaLIX0OMBvV/+SATmu/O9QXkDgsZlIg=",
"owner": "fort-nix",
"repo": "nix-bitcoin",
"rev": "6e208d6a7b554be592167f6ecad9b16c0abf96d7",
"type": "github"
},
"original": {
"owner": "fort-nix",
"ref": "release",
"repo": "nix-bitcoin",
"type": "github"
}
},
"crane": {
"locked": {
"lastModified": 1725409566,
"narHash": "sha256-PrtLmqhM6UtJP7v7IGyzjBFhbG4eOAHT6LPYOFmYfbk=",
"owner": "ipetkov",
"repo": "crane",
"rev": "7e4586bad4e3f8f97a9271def747cf58c4b68f3c",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"darwin": { "darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -95,11 +132,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1722113426, "lastModified": 1728330715,
"narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=", "narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=",
"owner": "numtide", "owner": "numtide",
"repo": "devshell", "repo": "devshell",
"rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae", "rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -108,37 +145,70 @@
"type": "github" "type": "github"
} }
}, },
"extra-container": {
"inputs": {
"flake-utils": [
"btc",
"flake-utils"
],
"nixpkgs": [
"btc",
"nixpkgs"
]
},
"locked": {
"lastModified": 1722175938,
"narHash": "sha256-HKyB4HD+NdX3T233bY31hm76v3/tdQBNeLLvopKbZeY=",
"owner": "erikarvstedt",
"repo": "extra-container",
"rev": "37e7207ac9f857eedb58b208b9dc91cd6b24e651",
"type": "github"
},
"original": {
"owner": "erikarvstedt",
"repo": "extra-container",
"type": "github"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
"zed",
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1726554553,
"narHash": "sha256-xakDhIS1c1VgJc/NMOLj05yBsTdlXKMEYz6wC8Hdshc=",
"owner": "nix-community",
"repo": "fenix",
"rev": "1f59d7585aa06d2c327960d397bea4067d8fee98",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"flake": false,
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"revCount": 57, "type": "github"
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
}, },
"original": { "original": {
"type": "tarball", "owner": "edolstra",
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" "repo": "flake-compat",
"type": "github"
} }
}, },
"flake-compat_2": { "flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_3": {
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
@@ -152,7 +222,7 @@
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
} }
}, },
"flake-compat_4": { "flake-compat_3": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1696426674,
@@ -168,19 +238,77 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_4": {
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"revCount": 57,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-compat_5": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_6": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_7": {
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": "nixpkgs-lib"
"nixvimstable",
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1722555600, "lastModified": 1727826117,
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d", "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -190,6 +318,27 @@
} }
}, },
"flake-parts_2": { "flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"nixvimstable",
"nixpkgs"
]
},
"locked": {
"lastModified": 1725234343,
"narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "567b938d64d4b4112ee253b9274472dc3a346eb6",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_3": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
"nixvimunstable", "nixvimunstable",
@@ -197,11 +346,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1722555600, "lastModified": 1727826117,
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d", "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -233,11 +382,11 @@
"systems": "systems_3" "systems": "systems_3"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1726560853,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -264,10 +413,28 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_4": {
"inputs": {
"systems": "systems_5"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"git-hooks": { "git-hooks": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_3",
"gitignore": "gitignore", "gitignore": "gitignore_2",
"nixpkgs": [ "nixpkgs": [
"nixvimstable", "nixvimstable",
"nixpkgs" "nixpkgs"
@@ -278,11 +445,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723202784, "lastModified": 1724857454,
"narHash": "sha256-qbhjc/NEGaDbyy0ucycubq4N3//gDFFH3DOmp1D3u1Q=", "narHash": "sha256-Qyl9Q4QMTLZnnBb/8OuQ9LSkzWjBU1T5l5zIzTxkkhk=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "c7012d0c18567c889b948781bc74a501e92275d1", "rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -297,7 +464,7 @@
"nixvimunstable", "nixvimunstable",
"flake-compat" "flake-compat"
], ],
"gitignore": "gitignore_2", "gitignore": "gitignore_3",
"nixpkgs": [ "nixpkgs": [
"nixvimunstable", "nixvimunstable",
"nixpkgs" "nixpkgs"
@@ -308,11 +475,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723202784, "lastModified": 1729104314,
"narHash": "sha256-qbhjc/NEGaDbyy0ucycubq4N3//gDFFH3DOmp1D3u1Q=", "narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "c7012d0c18567c889b948781bc74a501e92275d1", "rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -322,6 +489,27 @@
} }
}, },
"gitignore": { "gitignore": {
"inputs": {
"nixpkgs": [
"hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"gitignore_2": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixvimstable", "nixvimstable",
@@ -343,7 +531,7 @@
"type": "github" "type": "github"
} }
}, },
"gitignore_2": { "gitignore_3": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixvimunstable", "nixvimunstable",
@@ -372,11 +560,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720042825, "lastModified": 1726989464,
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -393,11 +581,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723986931, "lastModified": 1729551526,
"narHash": "sha256-Fy+KEvDQ+Hc8lJAV3t6leXhZJ2ncU5/esxkgt3b8DEY=", "narHash": "sha256-7LAGY32Xl14OVQp3y6M43/0AtHYYvV6pdyBcp3eoz0s=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "2598861031b78aadb4da7269df7ca9ddfc3e1671", "rev": "5ec753a1fc4454df9285d8b3ec0809234defb975",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -458,11 +646,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723399884, "lastModified": 1729260213,
"narHash": "sha256-97wn0ihhGqfMb8WcUgzzkM/TuAxce2Gd20A8oiruju4=", "narHash": "sha256-jAvHoU/1y/yCuXzr2fNF+q6uKmr8Jj2xgAisK4QB9to=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "086f619dd991a4d355c07837448244029fc2d9ab", "rev": "09a0c0c02953318bf94425738c7061ffdc4cba75",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -471,6 +659,27 @@
"type": "github" "type": "github"
} }
}, },
"hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1727854478,
"narHash": "sha256-/odH2nUMAwkMgOS2nG2z0exLQNJS4S2LfMW0teqU7co=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "5f58871c9657b5fc0a7f65670fe2ba99c26c1d79",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"nix-darwin": { "nix-darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -479,11 +688,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1722924007, "lastModified": 1725189302,
"narHash": "sha256-+CQDamNwqO33REJLft8c26NbUi2Td083hq6SvAm2xkU=", "narHash": "sha256-IhXok/kwQqtusPsoguQLCHA+h6gKvgdCrkhIaN+kByA=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "91010a5613ffd7ee23ee9263213157a1c422b705", "rev": "7c4b53a7d9f3a3df902b3fddf2ae245ef20ebcda",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -500,11 +709,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1722924007, "lastModified": 1728901530,
"narHash": "sha256-+CQDamNwqO33REJLft8c26NbUi2Td083hq6SvAm2xkU=", "narHash": "sha256-I9Qd0LnAsEGHtKE9+uVR0iDFmsijWSy7GT0g3jihG4Q=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "91010a5613ffd7ee23ee9263213157a1c422b705", "rev": "a60ac02f9466f85f092e576fd8364dfc4406b5a6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -545,13 +754,121 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": { "nixpkgs-lib": {
"locked": { "locked": {
"lastModified": 1723175592, "lastModified": 1727825735,
"narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=", "narHash": "sha256-0xHYkMkeLVQAMa7gvkddbPqpxph+hDzdu1XdGPJR+Os=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1720386169,
"narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5e0ca22929f3342b19569b21b2f3462f053e497b", "rev": "194846768975b7ad2c4988bdb82572c00222c0d7",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1723221148,
"narHash": "sha256-7pjpeQlZUNQ4eeVntytU3jkw9dFK3k1Htgk2iuXjaD8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "154bcb95ad51bc257c2ce4043a725de6ca700ef6",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1719082008,
"narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9693852a2070b398ee123a329e68f0dab5526681",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1725001927,
"narHash": "sha256-eV+63gK0Mp7ygCR0Oy4yIYSNcum2VQwnZamHxYTNi+M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6e99f2a27d600612004fbd2c3282d614bfee6421",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1729070438,
"narHash": "sha256-KOTTUfPkugH52avUvXGxvWy8ibKKj4genodIYUED+Kc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5785b6bb5eaae44e627d541023034e1601455827",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1713805509,
"narHash": "sha256-YgSEan4CcrjivCNO5ZNzhg7/8ViLkZ4CB/GrGBVSudo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1e1dc66fe68972a76679644a5577828b6a7e8be4",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_6": {
"locked": {
"lastModified": 1726463316,
"narHash": "sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "99dc8785f6a0adac95f5e2ab05cc2e1bf666d172",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -563,11 +880,11 @@
}, },
"nixstable": { "nixstable": {
"locked": { "locked": {
"lastModified": 1723556749, "lastModified": 1727672256,
"narHash": "sha256-+CHVZnTnIYRLYsARInHYoWkujzcRkLY/gXm3s5bE52o=", "narHash": "sha256-9/79hjQc9+xyH+QxeMcRsA6hDyw6Z9Eo1/oxjvwirLk=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4a92571f9207810b559c9eac203d1f4d79830073", "rev": "1719f27dd95fd4206afb9cec9f415b539978827e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -579,11 +896,11 @@
}, },
"nixunstable": { "nixunstable": {
"locked": { "locked": {
"lastModified": 1723991338, "lastModified": 1729413321,
"narHash": "sha256-Grh5PF0+gootJfOJFenTTxDTYPidA3V28dqJ/WV7iis=", "narHash": "sha256-I4tuhRpZFa6Fu6dcH9Dlo5LlH17peT79vx1y1SpeKt0=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8a3354191c0d7144db9756a74755672387b702ba", "rev": "1997e4aa514312c1af7e2bda7fad1644e778ff26",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -596,20 +913,20 @@
"nixvimstable": { "nixvimstable": {
"inputs": { "inputs": {
"devshell": "devshell", "devshell": "devshell",
"flake-compat": "flake-compat", "flake-compat": "flake-compat_2",
"flake-parts": "flake-parts", "flake-parts": "flake-parts_2",
"git-hooks": "git-hooks", "git-hooks": "git-hooks",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_3",
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1723536338, "lastModified": 1725350106,
"narHash": "sha256-1bSEOtZBsAeCkg5vdDbDgOT3z91K8L/KE2s7J9hLYHw=", "narHash": "sha256-TaMMlI2KPJ3wCyxJk6AShOLhNuTeabHCnvYRkLBlEFs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "0b6aa80acbcb8387f2a4affb3dd22960ac2899aa", "rev": "0f2c31e6a57a83ed4e6fa3adc76749620231055d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -622,21 +939,21 @@
"nixvimunstable": { "nixvimunstable": {
"inputs": { "inputs": {
"devshell": "devshell_2", "devshell": "devshell_2",
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_4",
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_3",
"git-hooks": "git-hooks_2", "git-hooks": "git-hooks_2",
"home-manager": "home-manager_3", "home-manager": "home-manager_3",
"nix-darwin": "nix-darwin_2", "nix-darwin": "nix-darwin_2",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_4",
"nuschtosSearch": "nuschtosSearch", "nuschtosSearch": "nuschtosSearch",
"treefmt-nix": "treefmt-nix_2" "treefmt-nix": "treefmt-nix_2"
}, },
"locked": { "locked": {
"lastModified": 1723816538, "lastModified": 1729602958,
"narHash": "sha256-h37ltjdifkd7iLtMtBXSBBeYSTuBEKMW6ClFoC7nReQ=", "narHash": "sha256-eKGQKlj1oShfR6uqE1RjB4CgQ3DBrMS4VPrGPDKq1J4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "00f32f0430f82c74919c72af84bc95bf5ae434e4", "rev": "b076f006c6b0cc6644a651bd21d4449cc3e7e56d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -648,11 +965,11 @@
}, },
"nurpkgs": { "nurpkgs": {
"locked": { "locked": {
"lastModified": 1724159175, "lastModified": 1729607740,
"narHash": "sha256-3z9wRL+h+gTVFtecCUGrRaW6nvPPAtBCIDE9KAmZj7c=", "narHash": "sha256-t5KMIn74sJOQQGfn7W7oO7MppMJe2S2X8fvUZmRDjpU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "0b86d5643d99e3982471f0d79e553871c6f35396", "rev": "5d773635b50f6d3ab2af57d0e41dd8533c37238f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -670,11 +987,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723367906, "lastModified": 1728905062,
"narHash": "sha256-v1qA4WBGDI2uH/TVqRwuXSBP341W681psbzYJ8zrjog=", "narHash": "sha256-W/lClt0bRgFRO0WFtytX/LEILpPNq+FOjIfESpkeu5c=",
"owner": "NuschtOS", "owner": "NuschtOS",
"repo": "search", "repo": "search",
"rev": "6ca2c3ae05a915c160512bd41f6810f456c9b30d", "rev": "f82d3e1c1c9d1eaeb91878519e2d27b27c66ce84",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -686,17 +1003,38 @@
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"btc": "btc",
"darwin": "darwin_2", "darwin": "darwin_2",
"flake-utils": "flake-utils", "flake-parts": "flake-parts",
"hm": "hm", "hm": "hm",
"hmunstable": "hmunstable", "hmunstable": "hmunstable",
"hooks": "hooks",
"nix23_05": "nix23_05", "nix23_05": "nix23_05",
"nixstable": "nixstable", "nixstable": "nixstable",
"nixunstable": "nixunstable", "nixunstable": "nixunstable",
"nixvimstable": "nixvimstable", "nixvimstable": "nixvimstable",
"nixvimunstable": "nixvimunstable", "nixvimunstable": "nixvimunstable",
"nurpkgs": "nurpkgs", "nurpkgs": "nurpkgs",
"wsl": "wsl" "vsext": "vsext",
"wsl": "wsl",
"zed": "zed"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1726443025,
"narHash": "sha256-nCmG4NJpwI0IoIlYlwtDwVA49yuspA2E6OhfCOmiArQ=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "94b526fc86eaa0e90fb4d54a5ba6313aa1e9b269",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
} }
}, },
"systems": { "systems": {
@@ -759,6 +1097,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": { "treefmt-nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -767,11 +1120,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723454642, "lastModified": 1724833132,
"narHash": "sha256-S0Gvsenh0II7EAaoc9158ZB4vYyuycvMGKGxIbERNAM=", "narHash": "sha256-F4djBvyNRAXGusJiNYInqR6zIMI3rvlp6WiKwsRISos=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "349de7bc435bdff37785c2466f054ed1766173be", "rev": "3ffd842a5f50f435d3e603312eefa4790db46af5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -788,11 +1141,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723454642, "lastModified": 1729242555,
"narHash": "sha256-S0Gvsenh0II7EAaoc9158ZB4vYyuycvMGKGxIbERNAM=", "narHash": "sha256-6jWSWxv2crIXmYSEb3LEVsFkCkyVHNllk61X4uhqfCs=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "349de7bc435bdff37785c2466f054ed1766173be", "rev": "d986489c1c757f6921a48c1439f19bfb9b8ecab5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -801,20 +1154,40 @@
"type": "github" "type": "github"
} }
}, },
"vsext": {
"inputs": {
"flake-compat": "flake-compat_5",
"flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1729561800,
"narHash": "sha256-LRRLzpS7Rh6AzWempfz6xRmv09m4WLyeRKXpILGUnGY=",
"owner": "nix-community",
"repo": "nix-vscode-extensions",
"rev": "ba02ecf164ec8da6f4d33d1f1e270b4a84252d60",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-vscode-extensions",
"type": "github"
}
},
"wsl": { "wsl": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_4", "flake-compat": "flake-compat_6",
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_4",
"nixpkgs": [ "nixpkgs": [
"nixunstable" "nixunstable"
] ]
}, },
"locked": { "locked": {
"lastModified": 1713528946, "lastModified": 1729494942,
"narHash": "sha256-IBQta+xrEaI2S5UmYrXcgV7Tu7rGLQu2V3TeJseLPSg=", "narHash": "sha256-c/WV0R0WWuK2UAjTCGntaa+y1UVPsTUJZXqwwKxcmYs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NixOS-WSL", "repo": "NixOS-WSL",
"rev": "63c1247e12f269396ed2df8cdec3aed1f0f3928c", "rev": "f26ca94fdcfc1a3adfee70e4ed5e2d8b1bab4317",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -822,6 +1195,28 @@
"repo": "NixOS-WSL", "repo": "NixOS-WSL",
"type": "github" "type": "github"
} }
},
"zed": {
"inputs": {
"crane": "crane",
"fenix": "fenix",
"flake-compat": "flake-compat_7",
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1728487939,
"narHash": "sha256-HdiEVRssMJmn+ifa0oWhHzRXB9L4oyji0DZ3PopHSoY=",
"owner": "zed-industries",
"repo": "zed",
"rev": "f6d974f3b148c2d4f28b4ed97b9b6352915faeed",
"type": "github"
},
"original": {
"owner": "zed-industries",
"ref": "v0.156.x",
"repo": "zed",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",
+107 -94
View File
@@ -2,108 +2,121 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ {
description = "Greg's machines!"; description = "Greg's machines!";
inputs = { nixConfig = {
agenix = { extra-substituters = [
url = "github:ryantm/agenix"; "https://greg-hellings.cachix.org"
inputs.nixpkgs.follows = "nixunstable"; "https://cache.garnix.io"
}; ];
darwin = { extra-trusted-public-keys = [
url = "github:lnl7/nix-darwin/master"; "greg-hellings.cachix.org-1:y01Jl/L5evlhxdnUW6n56AiI1k8g1wxWhTxJCe7XSco="
inputs.nixpkgs.follows = "nixunstable"; "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g"
}; ];
flake-utils.url = "github:numtide/flake-utils"; };
hm = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixstable";
};
hmunstable = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixstable";
};
nixvimstable.url = "github:nix-community/nixvim/nixos-24.05";
nixvimunstable.url = "github:nix-community/nixvim/main";
nix23_05.url = "github:NixOS/nixpkgs/nixos-23.05";
nixstable.url = "github:nixos/nixpkgs/nixos-24.05";
nixunstable.url = "github:nixos/nixpkgs/nixos-unstable";
nurpkgs.url = "github:nix-community/NUR";
wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixunstable";
};
};
outputs = { inputs = {
agenix, agenix = {
darwin, url = "github:ryantm/agenix";
flake-utils, inputs.nixpkgs.follows = "nixunstable";
hm, };
hmunstable, btc = {
nix23_05, url = "github:fort-nix/nix-bitcoin/release";
nixstable, };
nixunstable, darwin = {
nurpkgs, url = "github:lnl7/nix-darwin/master";
wsl, inputs.nixpkgs.follows = "nixunstable";
};
flake-parts.url = "github:hercules-ci/flake-parts";
hooks.url = "github:cachix/git-hooks.nix";
hm = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixstable";
};
hmunstable = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixstable";
};
nixvimstable.url = "github:nix-community/nixvim/nixos-24.05";
nixvimunstable.url = "github:nix-community/nixvim/main";
nix23_05.url = "github:NixOS/nixpkgs/nixos-23.05";
nixstable.url = "github:nixos/nixpkgs/nixos-24.05";
nixunstable.url = "github:nixos/nixpkgs/nixos-unstable";
nurpkgs.url = "github:nix-community/NUR";
vsext.url = "github:nix-community/nix-vscode-extensions";
wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixunstable";
};
zed.url = "github:zed-industries/zed/v0.156.x";
};
self, outputs =
...}@inputs: { self, ... }@top:
let let
local_overlay = import ./overlays; local_overlay = import ./overlays;
overlays = [ packages_overlay = (
agenix.overlays.default _: prev:
local_overlay (import ./pkgs {
nurpkgs.overlay inherit self;
]; pkgs = prev;
}).packages
);
overlays = [
top.agenix.overlays.default
local_overlay
packages_overlay
top.nurpkgs.overlay
top.vsext.overlays.default
(_: _: { zed-editor = top.zed.packages.x86_64-linux.default; })
];
in { in
#checks = { top.flake-parts.lib.mkFlake { inputs = top; } {
# x86_64-linux = { systems = [
# unstable = self.nixosConfigurations.jude.config.system.build.toplevel; "aarch64-linux"
# stable = self.nixosConfigurations.linode.config.system.build.toplevel; "x86_64-linux"
# }; "aarch64-darwin"
# aarch64-linux = { ];
# unstable = self.nixosConfigurations.nixos.config.system.build.toplevel;
# };
#};
nixosConfigurations = (import ./hosts { inherit inputs overlays; }); flake = {
nixosConfigurations = (import ./hosts { inherit top overlays; });
darwinConfigurations = (import ./darwin { inherit inputs overlays; }); darwinConfigurations = (import ./darwin { inherit top overlays; });
homeConfigurations = (import ./home { inherit inputs overlays; }); homeConfigurations = (import ./home { inherit top overlays; });
devShells = (flake-utils.lib.eachSystemMap flake-utils.lib.allSystems (system: let overlays = {
pkgs = import nixunstable { inherit system overlays; }; default = packages_overlay;
in { local = local_overlay;
default = pkgs.mkShell { };
buildInputs = with pkgs; [
bashInteractive
curl
git
gnutar
gzip
inject
inject-darwin
tmux
vim
xonsh
];
};
}));
overlays = { modules = import ./modules;
default = local_overlay; };
};
modules = import ./modules; perSystem =
{
packages = { pkgs,
x86_64-linux = rec { self',
default = iso-beta; system,
iso = self.nixosConfigurations.iso.config.system.build.isoImage; ...
iso-beta = self.nixosConfigurations.iso-beta.config.system.build.isoImage; }:
}; {
}; _module.args = {
}; pkgs = import top.nixstable { inherit system overlays; };
};
imports = [ ./pkgs ];
checks = import ./checks.nix {
inherit system;
inherit (top) hooks;
};
devShells = import ./shells.nix {
inherit self' pkgs;
inherit (top) nixvimunstable;
};
};
};
} }
+23 -14
View File
@@ -1,28 +1,37 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "uas" "sd_mod" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"thunderbolt"
"nvme"
"uas"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/607b933f-2967-4652-b478-4d8e9aa38a0d"; device = "/dev/disk/by-uuid/607b933f-2967-4652-b478-4d8e9aa38a0d";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@" ]; options = [ "subvol=@" ];
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/B31C-C1F4"; device = "/dev/disk/by-uuid/B31C-C1F4";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ ]; swapDevices = [ ];
+24 -22
View File
@@ -1,26 +1,28 @@
{ { top, overlays, ... }:
inputs,
overlays,
...
}:
rec { rec {
greghellings = greghellings =
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = (import inputs.nixunstable { inherit system overlays; }); pkgs = (
in inputs.hmunstable.lib.homeManagerConfiguration { import top.nixunstable {
inherit pkgs; inherit system overlays;
modules = [ ./home.nix ]; config.allowUnfree = true;
extraSpecialArgs = { }
inherit inputs; );
nixvim = inputs.nixvimunstable; in
gui = false; top.hmunstable.lib.homeManagerConfiguration {
gnome = false; inherit pkgs;
host = "ivr"; modules = [ ./home.nix ];
username = "gregory.hellings"; extraSpecialArgs = {
}; inherit top;
}; nixvim = top.nixvimunstable;
gui = false;
gnome = false;
host = "ivr";
username = "gregory.hellings";
};
};
"gregory.hellings" = greghellings; "gregory.hellings" = greghellings;
} }
+41 -45
View File
@@ -1,52 +1,48 @@
{ pkgs, lib, {
inputs, pkgs,
lib,
host ? "most", host ? "most",
nixvim, nixvim,
...}: ...
}:
let
system = pkgs.system;
in
{ {
nixpkgs.config.allowUnfreePredicate = (_: true); nixpkgs.config.allowUnfreePredicate = (_: true);
imports = [ imports = [
nixvim.homeManagerModules.default nixvim.homeManagerModules.default
./modules ./modules
] ++ lib.optionals (builtins.pathExists ./hosts/${host}) [ ./hosts/${host} ]; ] ++ lib.optionals (builtins.pathExists ./hosts/${host}) [ ./hosts/${host} ];
programs.tmux = {
enable = true;
keyMode = "vi";
terminal = "xterm-256color";
customPaneNavigationAndResize = true;
extraConfig = (lib.strings.concatStringsSep "\n" [ "bind P paste-buffer" ]);
};
programs.tmux = { home.stateVersion = "23.05";
enable = true; home.packages = with pkgs; [
keyMode = "vi"; bitwarden-cli
terminal = "xterm-256color"; copier
customPaneNavigationAndResize = true; diffutils
extraConfig = (lib.strings.concatStringsSep "\n" [ findutils
"bind P paste-buffer" gh
]); git
}; gnupatch
hms
home.stateVersion = "23.05"; htop
home.packages = with pkgs; [ inetutils
bitwarden-cli jq
copier nano
diffutils nix-prefetch
findutils nmap
gh openssl
git setup-ssh
gnupatch tmux
hms tree
htop unzip
inetutils wget
jq zip
nano ];
nix-prefetch
nmap
openssl
setup-ssh
tmux
tree
unzip
wget
zip
];
} }
+12 -10
View File
@@ -1,13 +1,15 @@
{ pkgs, config, ... }: { pkgs, ... }:
{ {
greg = { greg = {
vscodium = true; vscodium = true;
development = true; development = true;
gnome = true; gnome = true;
gui = true; gui = true;
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
cargo cargo
]; freeciv
#freeciv_qt
];
} }
-1
View File
@@ -1,5 +1,4 @@
{ ... }: { ... }:
{ {
} }
+68 -50
View File
@@ -1,52 +1,70 @@
{ pkgs, lib, inputs, ...}: {
pkgs,
lib,
top,
...
}:
let let
nix23 = import inputs.nix23_05 { nix23 = import top.nix23_05 {
inherit (pkgs.stdenv) system; inherit (pkgs.stdenv) system;
overlays = [ inputs.self.overlays.default ]; overlays = [ top.self.overlays.default ];
}; };
py = nix23.python311.withPackages ( p: with p; [ py = nix23.python311.withPackages (
django p: with p; [
djangorestframework pyyaml
django-rapyd-modernauth ruamel-yaml
environs tox
mysqlclient ]
pyyaml );
ruamel-yaml x = pkgs.xonsh.override {
tox extraPackages = (
]); ps: [
x = pkgs.xonsh.override { pkgs.nur.repos.xonsh-xontribs.xonsh-direnv
extraPackages = (ps: [ pkgs.nur.repos.xonsh-xontribs.xontrib-vox
pkgs.nur.repos.xonsh-xontribs.xonsh-direnv ps.xonsh-apipenv
pkgs.nur.repos.xonsh-xontribs.xontrib-vox pkgs.pipenv-ivr
]); ]
}; );
in { };
greg = { in
development = true; {
pypackage = py; greg = {
vscodium = true; development = true;
}; gui = true;
home = { pypackage = py;
packages = with pkgs; [ vscodium = true;
aacs };
ansible
bitwarden-cli nixpkgs.config = {
direnv allowUnfree = true;
home-manager permittedInsecurePackages = [ "jitsi-meet-1.0.8043" ];
insomnia };
pipenv-ivr
poetry home = {
x packages = with pkgs; [
]; aacs
file.".pip/pip.conf".text = (lib.strings.concatStringsSep "\n" [ ansible
"[global]" bitwarden-cli
"retries = 1" direnv
"index-url = https://pypi.python.org/simple" home-manager
"extra-index-url =" mysql-workbench
" https://pypi.ivrtechnology.com/simple/" pipenv-ivr
" https://pypidev.ivrtechnology.com/simple/" poetry
]); robo3t
username = "gregory.hellings"; x
homeDirectory = lib.mkForce "/home/gregory.hellings"; ];
}; file.".pip/pip.conf".text = (
lib.strings.concatStringsSep "\n" [
"[global]"
"retries = 1"
"index-url = https://pypi.python.org/simple"
"extra-index-url ="
" https://pypi.ivrtechnology.com/simple/"
" https://pypidev.ivrtechnology.com/simple/"
]
);
username = "gregory.hellings";
homeDirectory = lib.mkForce "/home/gregory.hellings";
};
programs.tmux.shell = (lib.getExe x);
} }
+12 -12
View File
@@ -1,17 +1,17 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
(mumble.override { pulseSupport = true; }) (mumble.override { pulseSupport = true; })
#logseq #logseq
]; ];
greg = { greg = {
development = true; development = true;
gui = true; gui = true;
sway = false; sway = false;
gnome = true; gnome = false;
vscodium = true; vscodium = true;
}; };
programs.xonsh.sessionVariables.EFI_DIR = "${pkgs.OVMF.fd}/FV/"; programs.xonsh.sessionVariables.EFI_DIR = "${pkgs.OVMF.fd}/FV/";
} }
+2 -4
View File
@@ -1,9 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
greg.vscodium.enable = true; greg.vscodium.enable = true;
home.packages = with pkgs; [ home.packages = with pkgs; [ brew ];
brew
];
} }
+21 -21
View File
@@ -1,28 +1,28 @@
{ ... }: { ... }:
{ {
home.file.".ansible.cfg".text = '' home.file.".ansible.cfg".text = ''
[defaults] [defaults]
forks=10 forks=10
host_key_checking=False host_key_checking=False
# Also available: profile_roles # Also available: profile_roles
callback_enabled=timer,profile_tasks callback_enabled=timer,profile_tasks
stdout_callback=yaml stdout_callback=yaml
nocows=1 nocows=1
cow_selection=tux cow_selection=tux
collections_path=~/src collections_path=~/src
[ssh_connection] [ssh_connection]
pipelining=True pipelining=True
ssh_args = -o ControlMaster=auto -o ControlPersist=600s -o IdentitiesOnly=yes -o GSSAPIAuthentication=no -o StrictHostKeyChecking=no ssh_args = -o ControlMaster=auto -o ControlPersist=600s -o IdentitiesOnly=yes -o GSSAPIAuthentication=no -o StrictHostKeyChecking=no
control_path=%(directory)s/%%h-%%r control_path=%(directory)s/%%h-%%r
control_path_dir=/tmp control_path_dir=/tmp
[callback_profile_tasks] [callback_profile_tasks]
sort_order=descending sort_order=descending
[galaxy] [galaxy]
role_skeleton_ignore = ^.git$,^.*/.git_keep$,\..*.swp role_skeleton_ignore = ^.git$,^.*/.git_keep$,\..*.swp
role_skeleton = ~/src/ansible_collections/meta_ansible_templates/role role_skeleton = ~/src/ansible_collections/meta_ansible_templates/role
''; '';
} }
+83 -83
View File
@@ -1,93 +1,93 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
programs.bash = { programs.bash = {
enable = true; enable = true;
shellAliases = { shellAliases = {
acp = "rsync --progress -ah"; acp = "rsync --progress -ah";
agbuild = "ansible-galaxy collection build"; agbuild = "ansible-galaxy collection build";
apub = "ansible-galaxy collection publish --api-key \${GALAXY_API_KEY}"; apub = "ansible-galaxy collection publish --api-key \${GALAXY_API_KEY}";
calc = "bc"; calc = "bc";
d = "deactivate"; d = "deactivate";
devroles = "cd ~/src/ansible_collections/devroles"; devroles = "cd ~/src/ansible_collections/devroles";
gohome = "ssh greg@dns.greg-hellings.gmail.com.beta.tailscale.net -D localhost:10080"; gohome = "ssh greg@dns.greg-hellings.gmail.com.beta.tailscale.net -D localhost:10080";
ll = "ls -l"; ll = "ls -l";
molcol = "molecule -c ../../tests/molecule.yml"; molcol = "molecule -c ../../tests/molecule.yml";
packaging = "cd ~/src/packaging"; packaging = "cd ~/src/packaging";
vdown = "vagrant destroy"; vdown = "vagrant destroy";
vhalt = "vagrant halt"; vhalt = "vagrant halt";
vos = "vagrant up --provision --provider openstack"; vos = "vagrant up --provision --provider openstack";
vprov = "vagrant provision"; vprov = "vagrant provision";
vssh = "vagrant ssh"; vssh = "vagrant ssh";
vup = "vagrant up --provision --provider libvirt"; vup = "vagrant up --provision --provider libvirt";
yaml2js = "python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)"; yaml2js = "python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)";
}; };
sessionVariables = { sessionVariables = {
ANSIBLE_COLLECTIONS_PATH="\${HOME}/src/"; ANSIBLE_COLLECTIONS_PATH = "\${HOME}/src/";
CLICOLOR = "1"; CLICOLOR = "1";
EDITOR = "${pkgs.vim}/bin/vim"; EDITOR = "${pkgs.vim}/bin/vim";
GIT_SSL_NO_VERIFY = "True"; GIT_SSL_NO_VERIFY = "True";
LSCOLORS = "ExGxBxDxCxEgEdxbxgxcxd"; LSCOLORS = "ExGxBxDxCxEgEdxbxgxcxd";
MAVEN_OPTS = " -Dmaven.wagon.http.ssl.insecure=true "; MAVEN_OPTS = " -Dmaven.wagon.http.ssl.insecure=true ";
OS_CLOUD = "default"; OS_CLOUD = "default";
SWORD_PATH = "\${HOME}/.sword"; SWORD_PATH = "\${HOME}/.sword";
TIMEFORMAT = "%3Uu %3Ss %3lR %P%%"; TIMEFORMAT = "%3Uu %3Ss %3lR %P%%";
}; };
profileExtra = '' profileExtra = ''
if [ -e /etc/profile ]; then if [ -e /etc/profile ]; then
. /etc/profile . /etc/profile
fi fi
''; '';
bashrcExtra = '' bashrcExtra = ''
function swordtag { function swordtag {
if [ x"$1" == "x" ]; then if [ x"$1" == "x" ]; then
echo "Please provide tag version" echo "Please provide tag version"
return return
fi fi
svn cp http://crosswire.org/svn/sword/branches/sword-1-8-x/ http://crosswire.org/svn/sword/tags/sword-$1/ svn cp http://crosswire.org/svn/sword/branches/sword-1-8-x/ http://crosswire.org/svn/sword/tags/sword-$1/
} }
function newdock { function newdock {
if [ x"$1" == "x" -o x"$2" == "x" ]; then if [ x"$1" == "x" -o x"$2" == "x" ]; then
echo "expected arguments [name] [source]" echo "expected arguments [name] [source]"
return return
fi fi
podman run -P --privileged=true -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v "$(pwd):/dmnt" -t -i --name="$1" "$2" /bin/bash podman run -P --privileged=true -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v "$(pwd):/dmnt" -t -i --name="$1" "$2" /bin/bash
} }
function rundock { function rundock {
podman start -a -i "$1" podman start -a -i "$1"
} }
function ac { function ac {
source ~/venv/''${1}/bin/activate source ~/venv/''${1}/bin/activate
} }
function py2env { function py2env {
/usr/bin/virtualenv -p /usr/bin/python2 "''${HOME}/venv/''${1}" /usr/bin/virtualenv -p /usr/bin/python2 "''${HOME}/venv/''${1}"
"''${HOME}/venv/''${1}/bin/pip" install -U pip "''${HOME}/venv/''${1}/bin/pip" install -U pip
} }
function py3env { function py3env {
VENV_NAME="''${1}" VENV_NAME="''${1}"
#PYVERSION="$(python3 -c "import sys;print(sys.version[:sys.version.find('.',2)])")" #PYVERSION="$(python3 -c "import sys;print(sys.version[:sys.version.find('.',2)])")"
#SITE_PACKAGES_PATH="/usr/lib64/python''${PYVERSION}/site-packages/" #SITE_PACKAGES_PATH="/usr/lib64/python''${PYVERSION}/site-packages/"
#VENV_SITE_PACKAGES="''${HOME}/venv/''${VENV_NAME}/lib64/python''${PYVERSION}/site-packages/" #VENV_SITE_PACKAGES="''${HOME}/venv/''${VENV_NAME}/lib64/python''${PYVERSION}/site-packages/"
# Create the virtualenv and update pip to latest # Create the virtualenv and update pip to latest
/usr/bin/python3 -m venv --clear "''${HOME}/venv/''${VENV_NAME}" --system-site-packages /usr/bin/python3 -m venv --clear "''${HOME}/venv/''${VENV_NAME}" --system-site-packages
"''${HOME}/venv/''${1}/bin/python3" -m pip install -U pip "''${HOME}/venv/''${1}/bin/python3" -m pip install -U pip
# Link SELinux into the environment if necessary # Link SELinux into the environment if necessary
#if [ -d "''${SITE_PACKAGES_PATH}" ]; then #if [ -d "''${SITE_PACKAGES_PATH}" ]; then
# ln -s "''${SITE_PACKAGES_PATH}/selinux" "''${VENV_SITE_PACKAGES}" # ln -s "''${SITE_PACKAGES_PATH}/selinux" "''${VENV_SITE_PACKAGES}"
# ln -s ''${SITE_PACKAGES_PATH}/_selinux*.so "''${VENV_SITE_PACKAGES}" # ln -s ''${SITE_PACKAGES_PATH}/_selinux*.so "''${VENV_SITE_PACKAGES}"
#else #else
# echo "ERROR: LibSELinux not found for Python ''${PYVERSION}. Install system package to enable." # echo "ERROR: LibSELinux not found for Python ''${PYVERSION}. Install system package to enable."
#fi #fi
} }
function unknown_host { function unknown_host {
sed -i -e ''${1}d ~/.ssh/known_hosts sed -i -e ''${1}d ~/.ssh/known_hosts
} }
''; '';
}; };
} }
+9 -9
View File
@@ -1,13 +1,13 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
./ansible.nix ./ansible.nix
./bash.nix ./bash.nix
./direnv.nix ./direnv.nix
./git.nix ./git.nix
./ssh.nix ./ssh.nix
./vim.nix ./vim.nix
./xonsh.nix ./xonsh.nix
]; ];
} }
+18 -5
View File
@@ -1,8 +1,21 @@
{ pkgs, ... }: { ... }:
{ {
programs.direnv = { programs.direnv = {
enable = true; enable = true;
nix-direnv.enable = true; nix-direnv.enable = true;
}; stdlib = ''
layout_poetry() {
if [[ ! -f pyproject.toml ]]; then
echo "No pyproject.toml found"
exit 1
fi
venv="$(dirname "$(poetry run which python)")"
export VIRTUAL_ENV="$(echo "$venv" | rev | cut -d'/' -f2- | rev)"
export POETRY_ACTIVE=1
PATH_add "$venv"
}
'';
};
} }
+29 -27
View File
@@ -1,31 +1,33 @@
{ ... }: { ... }:
{ {
programs.git = { programs.git = {
enable = true; enable = true;
userName = "Greg Hellings"; userName = "Greg Hellings";
userEmail = "greg.hellings@gmail.com"; userEmail = "greg.hellings@gmail.com";
aliases = { aliases = {
st = "status"; st = "status";
ci = "commit"; ci = "commit";
co = "checkout"; co = "checkout";
ups = "push -u origin HEAD"; ups = "push -u origin HEAD";
amend = "commit --amend"; amend = "commit --amend";
}; };
ignores = [ ignores = [
".*.swp" ".*.swo" ".*.swn" # vim ".*.swp"
".idea" # IntelliJ ".*.swo"
".DS_Store" # Macs ".*.swn" # vim
"Thumbs.db" # Windows ".idea" # IntelliJ
".tox" # Tox temp directory ".DS_Store" # Macs
".eclipse" # These next two are created by VSCodium plugins "Thumbs.db" # Windows
".bazelproject" ".tox" # Tox temp directory
]; ".eclipse" # These next two are created by VSCodium plugins
extraConfig = { ".bazelproject"
init.defaultBranch = "main"; ];
push.default = "upstream"; extraConfig = {
pull.rebase = "false"; init.defaultBranch = "main";
tag.sort = "version:refname"; push.default = "upstream";
}; pull.rebase = "false";
}; tag.sort = "version:refname";
};
};
} }
+60 -50
View File
@@ -1,64 +1,74 @@
{ lib, ... }: { lib, ... }:
{ {
# Workaround to set the config value to user read-only # Workaround to set the config value to user read-only
# This allows things like SSH in distrobox to read the config file just fine # This allows things like SSH in distrobox to read the config file just fine
home.file.".ssh/config" = { home.file.".ssh/config" = {
target = ".ssh/config_source"; target = ".ssh/config_source";
onChange = ''cat ~/.ssh/config_source > ~/.ssh/config && chmod 600 ~/.ssh/config''; onChange = ''cat ~/.ssh/config_source > ~/.ssh/config && chmod 600 ~/.ssh/config'';
}; };
programs.ssh = { programs.ssh = {
enable = true; enable = true;
serverAliveInterval = 60; serverAliveInterval = 60;
includes = ["config.local"]; includes = [ "config.local" ];
matchBlocks = matchBlocks =
let let
nas = { user = "admin"; }; nas = {
owned = { user = "greg"; }; user = "admin";
in { };
inherit nas; owned = {
user = "greg";
};
in
{
inherit nas;
"*" = { "*" = {
dynamicForwards = [ { dynamicForwards = [ { port = 10240; } ];
port = 10240; };
} ];
};
"10.42.1.4" = lib.hm.dag.entryBefore ["10.42.*"] nas; "10.42.1.4" = lib.hm.dag.entryBefore [ "10.42.*" ] nas;
"nas.thehellings.lan" = nas; "nas.thehellings.lan" = nas;
"nas.greg-hellings.gmail.com.beta.tailscale.net" = nas; "nas.greg-hellings.gmail.com.beta.tailscale.net" = nas;
chronicles = nas; chronicles = nas;
"chronicles.thehellings.lan" = lib.hm.dag.entryBefore [ "*.thehellings.lan"] nas; "chronicles.thehellings.lan" = lib.hm.dag.entryBefore [ "*.thehellings.lan" ] nas;
gh = { user = "git"; hostname = "github.com"; }; gh = {
"src" = { user = "git";
user = "gitlab"; hostname = "github.com";
hostname = "git.thehellings.lan"; };
}; "src" = {
user = "gitlab";
hostname = "git.thehellings.lan";
};
ivr = {
user = "git";
hostname = "gitlab.com";
};
"*.thehellings.lan" = owned; "*.thehellings.lan" = owned;
"10.42.*" = owned; "10.42.*" = owned;
"host.crosswire.org crosswire" = { "host.crosswire.org crosswire" = {
hostname = "host.crosswire.org"; hostname = "host.crosswire.org";
user = "ghellings"; user = "ghellings";
}; };
fedpeople = { fedpeople = {
hostname = "fedorapeople.org"; hostname = "fedorapeople.org";
user = "greghellings"; user = "greghellings";
}; };
"src.fedoraproject.org pkgs.fedoraproject.org" = { "src.fedoraproject.org pkgs.fedoraproject.org" = {
user = "greghellings"; user = "greghellings";
}; };
"127.*".extraOptions = { "127.*".extraOptions = {
PubkeyAcceptedAlgorithms = "+ssh-rsa"; PubkeyAcceptedAlgorithms = "+ssh-rsa";
HostkeyAlgorithms = "+ssh-rsa"; HostkeyAlgorithms = "+ssh-rsa";
}; };
}; };
}; };
} }
+12 -122
View File
@@ -1,126 +1,16 @@
{ pkgs, ... }:
let
vim-stabs = pkgs.vimUtils.buildVimPlugin {
name = "vim-stabs";
src = pkgs.fetchFromGitHub {
owner = "Thyrum";
repo = "vim-stabs";
rev = "4654d4e000680e1f608b40f155af08873446ed63";
sha256 = "0hi1c5zv38hwxbyrf11fz97r728jgbppz4is7fwzwhfrzhwbw0ga";
};
};
vim-xonsh = pkgs.vimUtils.buildVimPlugin {
name = "vim-xonsh";
src = pkgs.fetchFromGitHub {
owner = "meatballs";
repo = "vim-xonsh";
rev = "2028aac";
sha256 = "sha256-0+dqtlz8LeyOoSiS12rv8aLdzOMj31PuYAyDYWnpNzw=";
};
};
in
{ {
home.packages = with pkgs; [ config,
ansible-language-server pkgs,
pyright lib,
]; ...
}:
programs.nixvim = { {
enable = true; # The Hack font is used in the Fugitive sidebars
colorschemes.gruvbox.enable = true; fonts.fontconfig.enable = true;
globals = { home.packages = [ (pkgs.nerdfonts.override { fonts = [ "Hack" ]; }) ];
indent_guides_enable_on_vim_startup = 1;
nix_recommended_style = 0;
};
opts = {
background = "dark";
backup = false;
copyindent = true;
cursorline = true;
expandtab = false;
hidden = true;
hlsearch = true;
ignorecase = true;
lazyredraw = true;
list = true;
listchars = "tab: ,extends:,precedes:,trail:·,eol:¬";
mouse = "a";
number = true;
preserveindent = true;
relativenumber = true;
shiftwidth = 4;
showcmd = true;
showmatch = true;
signcolumn = "yes";
smartcase = true;
softtabstop = 4;
tabstop = 4;
# Setting for CtrlP
wildignore = "*.swp,*.pyc,*.class,.tox";
wrap = false;
writebackup = false;
};
keymaps = let
winMove = key: { mode = "n"; key = "<C-${key}>"; action = "<C-w>${key}<C-w><CR>"; };
in [ {
mode = "n";
key = "<C-e>";
action = "<Esc>:BufExplorer<CR>";
} {
mode = "n";
key = "<C-t>";
action = "<Esc>:NERDTreeToggle<CR>";
}
(winMove "h")
(winMove "j")
(winMove "k")
(winMove "l")
];
plugins = {
airline.enable = true;
cmp.enable = true;
direnv.enable = true;
gitgutter.enable = true;
fugitive.enable = true;
fzf-lua = {
enable = true;
iconsEnabled = true;
keymaps = {
"<C-o>" = {
action = "files";
settings = {
previewers.cat.cmd = "${pkgs.coreutils}/bin/cat";
winopts.height = 0.5;
};
};
"<C-p>" = {
action = "git_files";
settings = {
previewers.cat.cmd = "${pkgs.coreutils}/bin/cat";
winopts.height = 0.5;
};
};
};
profile = "fzf-vim";
};
notify.enable = true;
};
extraConfigLua = builtins.replaceStrings [ "@git@" ] [ "${pkgs.git}/bin/git" ] (builtins.readFile ./vim/extra.lua);
extraConfigVim = builtins.readFile ./vim/extra.vimrc;
extraPlugins = with pkgs.vimPlugins; [
bufexplorer
nerdtree
nvim-web-devicons # Be sure to install Hack Nerd Font and set it to your term default: https://gist.github.com/matthewjberger/7dd7e079f282f8138a9dc3b045ebefa0
packer-nvim
context-vim programs.nixvim = (import ./vim/config.nix { inherit config pkgs lib; }) // {
vim-flake8 enable = true;
vim-indent-guides };
vim-xonsh
];
viAlias = true;
vimAlias = true;
};
} }
+180
View File
@@ -0,0 +1,180 @@
{
config,
pkgs,
lib,
...
}:
let
vim-xonsh = pkgs.vimUtils.buildVimPlugin {
name = "vim-xonsh";
src = pkgs.fetchFromGitHub {
owner = "meatballs";
repo = "vim-xonsh";
rev = "929f35e";
hash = "sha256-ugHLu2Z9bTtQsIp4FQPKxgjVe9oZNjfQYrP+aHu+/uU=";
};
};
in
{
colorschemes.gruvbox.enable = true;
globals = {
indent_guides_enable_on_vim_startup = 1;
nix_recommended_style = 0;
};
opts = {
background = "dark";
backup = false;
copyindent = true;
cursorline = true;
expandtab = false;
hidden = true;
hlsearch = true;
ignorecase = true;
lazyredraw = true;
list = true;
listchars = "tab: ,extends:,precedes:,trail:·,eol:¬";
mouse = "a";
number = true;
preserveindent = true;
relativenumber = true;
shiftwidth = 4;
showcmd = true;
showmatch = true;
signcolumn = "yes";
smartcase = true;
softtabstop = 4;
tabstop = 4;
# Setting for CtrlP
wildignore = "*.swp,*.pyc,*.class,.tox";
wrap = false;
writebackup = false;
};
keymaps =
let
winMove = key: {
mode = "n";
key = "<C-${key}>";
action = "<C-w>${key}<C-w><CR>";
};
in
[
{
mode = "n";
key = "<C-e>";
action = "<Esc>:BufExplorer<CR>";
}
{
mode = "n";
key = "<C-t>";
#action = "<Esc>:NERDTreeToggle<CR>";
action = "<Esc>:Neotree toggle<CR>";
}
{
mode = "n";
key = "<C-g>";
action = "<Esc>:Git<CR>";
}
(winMove "h")
(winMove "j")
(winMove "k")
(winMove "l")
];
plugins = {
airline.enable = true;
cmp = {
enable = true;
autoEnableSources = true;
settings = {
sources = [
{ name = "nvim_lsp"; }
{
name = "buffer";
group_index = 2;
}
{
name = "copilot-vim";
group_index = 2;
}
{
name = "path";
gruop_index = 3;
}
];
mapping = {
"<C-Space>" = "cmp.mapping.complete()";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<C-f>" = "cmp.mapping.select_next_item()";
"<C-b>" = "cmp.mapping.select_prev_item()";
"<C-c>" = "cmp.mapping.abort()";
};
};
};
copilot-vim = {
enable = (config.nixpkgs.config ? "allowUnfree" && config.nixpkgs.config.allowUnfree);
settings.workspace_folders = [ "~/src/ivr" ];
};
direnv.enable = true;
gitgutter.enable = true;
fugitive.enable = true;
fzf-lua = {
enable = true;
keymaps = {
"<C-o>" = {
action = "files";
settings = {
previewers.cat.cmd = "${pkgs.coreutils}/bin/cat";
winopts.height = 0.5;
};
};
"<C-p>" = {
action = "git_files";
settings = {
previewers.cat.cmd = "${pkgs.coreutils}/bin/cat";
winopts.height = 0.5;
};
};
};
profile = "fzf-vim";
};
lsp = {
enable = true;
servers = {
ansiblels.enable = true;
cmake.enable = true;
gopls.enable = true;
html.enable = true;
nixd.enable = true;
pylsp.enable = true;
pyright.enable = true;
rust_analyzer = {
# No need to have these installed on every one of my systems
installCargo = false;
installRustc = false;
enable = true;
};
terraformls.enable = true;
};
};
neo-tree.enable = true;
notify.enable = true;
} // (if (lib.versionAtLeast lib.version "24.11") then { web-devicons.enable = true; } else { });
userCommands = {
Ggr = {
command = "Ggrep! <q-args> | cw | redraw!";
nargs = "+";
};
};
extraConfigLua = builtins.replaceStrings [ "@git@" ] [ "${pkgs.git}/bin/git" ] (
builtins.readFile ./extra.lua
);
extraConfigVim = builtins.readFile ./extra.vimrc;
extraPlugins = with pkgs.vimPlugins; [
bufexplorer
context-vim
vim-indent-guides
vim-xonsh
];
viAlias = true;
vimAlias = true;
}
+77 -61
View File
@@ -1,72 +1,88 @@
{ pkgs, config, lib, ... }: { pkgs, config, ... }:
{ {
programs.xonsh = { # Programs that are used in the settings file
enable = true; home.packages = with pkgs; [
bitwarden-cli
copier
git
gnused
nix-output-monitor
nvd
];
sessionVariables = { programs.xonsh = {
CLICOLOR = 1; enable = true;
EDITOR = "nvim";
# vte_new_tab_cwd causes new Terminal tabs to open in the
# same CWD as the current tab
LESS_TERMCAP_mb = "\\033[01;31m"; # begin blinking
LESS_TERMCAP_md = "\\033[01;31m"; # begin bold
LESS_TERMCAP_me = "\\033[0m"; # end mode
LESS_TERMCAP_so = "\\033[01;44;36m"; # begin standout-mode (bottom of screen)
LESS_TERMCAP_se = "\\033[0m"; # end standout-mode
LESS_TERMCAP_us = "\\033[00;36m"; # begin underline
LESS_TERMCAP_ue = "\\033[0m"; # end underline
LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN = "1";
LSCOLORS = "ExGxBxDxCxEgEdxbxgxcxd";
MAVEN_OPTS = " -Dmaven.wagon.http.ssl.insecure=true";
OS_CLOUD = "default";
PROMPT = "{vte_new_tab_cwd}{env_name}{BOLD_GREEN}{user}@{hostname}{BOLD_BLUE} {short_cwd}{branch_color}{curr_branch: {}}{RESET} {BOLD_BLUE}{prompt_end}{RESET} ";
SWORD_PATH = "${config.home.homeDirectory}/.sword/";
TIMEFORMAT = "%3Uu %3Ss %3lR %P%%";
# Tells vox where to find virtualenvs
VIRTUALENV_HOME = "${config.home.homeDirectory}/venv/";
XONSH_COLOR_STYLE = "default";
GOPATH = "${config.home.homeDirectory}/src/go"; sessionVariables = {
GOBIN = "${config.home.homeDirectory}/src/bin"; CLICOLOR = 1;
}; EDITOR = "nvim";
# vte_new_tab_cwd causes new Terminal tabs to open in the
# same CWD as the current tab
LESS_TERMCAP_mb = "\\033[01;31m"; # begin blinking
LESS_TERMCAP_md = "\\033[01;31m"; # begin bold
LESS_TERMCAP_me = "\\033[0m"; # end mode
LESS_TERMCAP_so = "\\033[01;44;36m"; # begin standout-mode (bottom of screen)
LESS_TERMCAP_se = "\\033[0m"; # end standout-mode
LESS_TERMCAP_us = "\\033[00;36m"; # begin underline
LESS_TERMCAP_ue = "\\033[0m"; # end underline
LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN = "1";
LSCOLORS = "ExGxBxDxCxEgEdxbxgxcxd";
MAVEN_OPTS = " -Dmaven.wagon.http.ssl.insecure=true";
OS_CLOUD = "default";
PROMPT = "{vte_new_tab_cwd}{env_name}{BOLD_GREEN}{user}@{hostname}{BOLD_BLUE} {short_cwd}{branch_color}{curr_branch: {}}{RESET} {BOLD_BLUE}{prompt_end}{RESET} ";
SWORD_PATH = "${config.home.homeDirectory}/.sword/";
TIMEFORMAT = "%3Uu %3Ss %3lR %P%%";
# Tells vox where to find virtualenvs
VIRTUALENV_HOME = "${config.home.homeDirectory}/venv/";
XONSH_COLOR_STYLE = "default";
aliases = { GOPATH = "${config.home.homeDirectory}/src/go";
# Python related ones GOBIN = "${config.home.homeDirectory}/src/bin";
ac = "vox activate"; };
d = "vox deactivate";
# Nix related ones aliases = {
gl-nging = "sudo nixos-container run gitlab -- systemctl restart nginx"; # Python related ones
nixup = "nix flake lock --update-input"; ac = "vox activate";
nixtest = "nixpkgs-review rev HEAD"; d = "vox deactivate";
nixdu = "sudo nix-store --gc --print-roots | egrep -v r\"^(/nix/var|/run/\\w+-system|\\{memory|/proc)\""; s = "nix run \".#runserver\"";
# General # Nix related ones
gh-personal = "$GH_CONFIG_DIR=\"${config.home.homeDirectory}/.config/gh/personal\" gh"; gl-nging = "sudo nixos-container run gitlab -- systemctl restart nginx";
ls = "ls --color"; nb = "nix build -L";
ll = "ls -l --color"; nixdu = "sudo nix-store --gc --print-roots | egrep -v r\"^(/nix/var|/run/\\w+-system|\\{memory|/proc)\"";
tf = "terraform"; nixtest = "nixpkgs-review rev HEAD";
nixup = "nix flake lock --update-input";
stable = "nix flake lock --update-input nixpkgs --update-input hm --update-input nixvimstable";
unstable = "nix flake lock --update-input nixunstable --update-input hmunstable --update-input nixvimunstable --update-input nurpkgs --update-input vsext --update-input wsl";
updateScript = "nix-shell maintainers/scripts/update.nix --argstr package";
# Tailscale related ones # General
tsup = "sudo tailscale up"; gh-personal = "$GH_CONFIG_DIR=\"${config.home.homeDirectory}/.config/gh/personal\" gh";
tspub = "sudo tailscale up --exit-node=linode"; ls = "ls --color";
tshome = "sudo tailscale up --exit-node=2maccabees"; ll = "ls -l --color";
tsclear = "sudo tailscale up --exit-node=''";
# Vagrant related # Tailscale related ones
vdown = "vagrant destroy"; tsup = "sudo tailscale up";
vhalt = "vagrant halt"; tspub = "sudo tailscale up --exit-node=linode";
vos = "vagrant up --provision --provider openstack"; tshome = "sudo tailscale up --exit-node=2maccabees";
vprov = "vagrant provision"; tsclear = "sudo tailscale up --exit-node=''";
vup = "vagrant up --provision --provider libvirt";
vssh = "vagrant ssh";
};
configHeader = builtins.readFile ./xonsh_header.xsh; # Vagrant related
configFooter = (builtins.readFile ./xonsh_footer.xsh) + (builtins.concatStringsSep "\n" [ vdown = "vagrant destroy";
"with open('${pkgs.stdenv.cc}/nix-support/dynamic-linker', 'r') as fp:" vhalt = "vagrant halt";
" $NIX_LD = fp.read().strip()" vos = "vagrant up --provision --provider openstack";
]); vprov = "vagrant provision";
}; vup = "vagrant up --provision --provider libvirt";
vssh = "vagrant ssh";
};
configHeader = builtins.readFile ./xonsh_header.xsh;
configFooter =
(builtins.readFile ./xonsh_footer.xsh)
+ (builtins.concatStringsSep "\n" [
"with open('${pkgs.stdenv.cc}/nix-support/dynamic-linker', 'r') as fp:"
" $NIX_LD = fp.read().strip()"
]);
};
} }
+14 -9
View File
@@ -1,6 +1,6 @@
# vim: set ft=python : # vim: set ft=xonsh :
from tempfile import NamedTemporaryFile from tempfile import NamedTemporaryFile, TemporaryDirectory
def bw_unlock(): def bw_unlock():
"""Unlocks the BitWarden CLI and adds the resulting session code to the """Unlocks the BitWarden CLI and adds the resulting session code to the
@@ -37,17 +37,15 @@ def _ivr(args):
vpn("350Main", "IVR Technology") vpn("350Main", "IVR Technology")
aliases['ivr'] = _ivr aliases['ivr'] = _ivr
def _ivr2(args):
vpn("gregory_hellings@ra.ivrtechnology.com", "IVR Technology")
aliases['ivr2'] = _ivr2
def _glrestart(args): def _glrestart(args):
sudo nixos-container run gitlab -- systemctl restart gitlab sudo nixos-container run gitlab -- systemctl restart gitlab
sudo nixos-container run gitlab -- systemctl restart nginx sudo nixos-container run gitlab -- systemctl restart nginx
aliases['glrestart'] = _glrestart aliases['glrestart'] = _glrestart
def _cfetch(args):
bw_unlock()
$CIRCLECI_CLI_TOKEN=$(bw get password CircleCI)
compass workspace exec bazel run src/go/compass.com/tools/circleci_results_cache/fetch/cmd/fetch:fetch
aliases['cfetch'] = _cfetch
def _aws_creds(args): def _aws_creds(args):
$AWS_ACCESS_KEY_ID=$(bw get username "AWS Access Key") $AWS_ACCESS_KEY_ID=$(bw get username "AWS Access Key")
$AWS_SECRET_ACCESS_KEY=$(bw get password "AWS Access Key") $AWS_SECRET_ACCESS_KEY=$(bw get password "AWS Access Key")
@@ -55,10 +53,17 @@ aliases['aws_creds'] = _aws_creds
def _rebuild(args): def _rebuild(args):
system = uname() system = uname()
hostname = system.nodename
if system.sysname == 'Darwin': if system.sysname == 'Darwin':
darwin-rebuild --flake ~/.config/darwin switch darwin-rebuild --flake ~/.config/darwin switch
else: else:
sudo nixos-rebuild switch with TemporaryDirectory() as td:
pushd @(td)
nom build f"/etc/nixos#nixosConfigurations.{hostname}.config.system.build.toplevel"
if g`result`:
nvd diff /run/current-system result
sudo result/bin/switch-to-configuration switch
popd
aliases['rebuild'] = _rebuild aliases['rebuild'] = _rebuild
def _yaml2json(args, stdin=None, stdout=None): def _yaml2json(args, stdin=None, stdout=None):
+10 -10
View File
@@ -1,14 +1,14 @@
{ ... }: { ... }:
{ {
imports = [ imports = [
./baseline ./baseline
./development.nix ./development.nix
./gnome.nix ./gnome.nix
./gui.nix ./gui.nix
./python.nix ./python.nix
./sway.nix ./sway.nix
./vscodium.nix ./vscodium.nix
./xonsh.nix ./xonsh.nix
]; ];
} }
+26 -14
View File
@@ -1,17 +1,29 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
packages = with pkgs; [ packages = with pkgs; [
cargo bruno # but let's not talk about it
mariadb cargo
nix-update gh-copilot
nixfmt-rfc-style mariadb
nixpkgs-review nix-eval-jobs
process-compose nix-fast-build
]; nix-output-monitor
in with lib; { nix-update
options.greg.development = mkEnableOption "Setup necessary development packages"; nixfmt-rfc-style
nixpkgs-review
nodejs
process-compose
zed-editor
];
in
with lib;
{
options.greg.development = mkEnableOption "Setup necessary development packages";
config = mkIf config.greg.development { config = mkIf config.greg.development { home.packages = packages; };
home.packages = packages;
};
} }
+128 -116
View File
@@ -1,121 +1,133 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
gv = lib.hm.gvariant; cfg = config.greg.gnome;
cfg = config.greg.gnome; in
{
options.greg.gnome = lib.mkEnableOption "Enable Gnome support and settings";
in { config = (
options.greg.gnome = lib.mkEnableOption "Enable Gnome support and settings"; lib.mkIf cfg {
programs.gnome-terminal = lib.mkIf (pkgs.system != "x86_64-darwin") {
enable = true;
showMenubar = true;
themeVariant = "dark";
profile."95f3c68e-82f3-4f44-ac85-6e075fed80b0" = {
default = true;
customCommand = "xonsh -st best";
loginShell = true;
scrollbackLines = 65535;
transparencyPercent = 50;
visibleName = "greg";
};
};
config = (lib.mkIf cfg { dconf.settings = {
programs.gnome-terminal = lib.mkIf ( pkgs.system != "x86_64-darwin") { "org/gnome/Disks" = {
enable = true; image-dir-uri = "file:///home/greg/Downloads";
showMenubar = true; };
themeVariant = "dark"; "org/gnome/desktop/interface" = {
profile."95f3c68e-82f3-4f44-ac85-6e075fed80b0" = { clock-show-weekday = true;
default = true; color-scheme = "default";
customCommand = "xonsh -st best"; cursor-size = 24;
loginShell = true; toolbar-style = "text";
scrollbackLines = 65535; };
transparencyPercent = 50; "org/gnome/desktop/screensaver" = {
visibleName = "greg"; lock-delay = "uint32 0";
}; lock-enabled = false;
}; };
"org/gnome/desktop/wm/keybindings" = {
dconf.settings = { switch-applications = [ ];
"org/gnome/Disks" = { switch-applications-backward = [ ];
image-dir-uri = "file:///home/greg/Downloads"; switch-windows = [ "<Alt>Tab" ];
}; switch-windows-backward = [ "<Shift><Alt>Tab" ];
"org/gnome/desktop/interface" = { };
clock-show-weekday = true; "org/gnome/desktop/wm/preferences" = {
color-scheme = "default"; button-layout = "icon:minimize,maximize,close";
cursor-size = 24; };
toolbar-style = "text"; "org/gnome/file-roller/listing" = {
}; list-mode = "as-folder";
"org/gnome/desktop/screensaver" = { name-coloumn-width = 302;
lock-delay = "uint32 0"; show-path = true;
lock-enabled = false; sort-method = "name";
}; sort-type = "ascending";
"org/gnome/desktop/wm/keybindings" = { };
switch-applications = []; "org/gnome/nautilus/preferences" = {
switch-applications-backward = []; default-folder-viewer = "icon-view";
switch-windows = ["<Alt>Tab"]; search-filter-time-type = "last_modified";
switch-windows-backward = [ "<Shift><Alt>Tab" ]; search-view = "list-view";
}; };
"org/gnome/desktop/wm/preferences" = { "org/gnome/shell" = {
button-layout="icon:minimize,maximize,close"; enabled-extensions = [
}; "appindicatorsupport@rgcjonas.gmail.com"
"org/gnome/file-roller/listing" = { "Vitals@CoreCoding.com"
list-mode = "as-folder"; "window-list@gnome-shell-extensions.gcampax.github.com"
name-coloumn-width = 302; "gsconnect@andyholmes.github.io"
show-path = true; ];
sort-method = "name"; favorite-apps = [
sort-type = "ascending"; "org.gnome.Calendar.desktop"
}; "org.gnome.Nautilus.desktop"
"org/gnome/nautilus/preferences" = { "org.gnome.Terminal.desktop"
default-folder-viewer = "icon-view"; "firefox.desktop"
search-filter-time-type = "last_modified"; "vlc.desktop"
search-view = "list-view"; ];
}; remember-mount-password = true;
"org/gnome/shell" = { };
enabled-extensions = [ "org/gnome/shell/extensions/vitals" = {
"appindicatorsupport@rgcjonas.gmail.com" hot-sensors = [
"Vitals@CoreCoding.com" "_memory_usage_"
"window-list@gnome-shell-extensions.gcampax.github.com" "_system_load_1m_"
"gsconnect@andyholmes.github.io" "__network-rx_max__"
]; "_temperature_k10temp_tccd1_"
favorite-apps = [ "_temperature_k10temp_tctl_"
"org.gnome.Calendar.desktop" ];
"org.gnome.Nautilus.desktop" };
"org.gnome.Console.desktop" "org/gnome/shell/overrides" = {
"firefox.desktop" attach-modal-dialogs = true;
"vlc.desktop" dynamic-workspaces = true;
]; edge-tiling = true;
remember-mount-password = true; focus-change-on-pointer-rest = true;
}; workspaces-only-on-primary = true;
"org/gnome/shell/extensions/vitals" = { };
hot-sensors = [ "org/gnome/shell/weather" = {
"_memory_usage_" automation-location = true;
"_system_load_1m_" locations = "[<(uint32 2, <('Midlothian / Waxahachie, Mid-Way Regional Airport', 'KJWY', false, [(0.5664611473274288, -1.691437359323684)], @a(dd) [])>)>]";
"__network-rx_max__" };
"_temperature_k10temp_tccd1_" "org/gnome/shell/window-switcher" = {
"_temperature_k10temp_tctl_" app-icon-mode = "both";
]; current-workspace-only = true;
}; };
"org/gnome/shell/overrides" = { "org/gtk/settings/file-chooser" = {
attach-modal-dialogs = true; location-mode = "path-bar";
dynamic-workspaces = true; show-hidden = false;
edge-tiling = true; show-size-column = true;
focus-change-on-pointer-rest = true; sort-column = "modified";
workspaces-only-on-primary = true; sort-directories-first = false;
}; sort-order = "descending";
"org/gnome/shell/weather" = { };
automation-location = true; "org/virt-manager/virt-manager/confirm" = {
locations = "[<(uint32 2, <('Midlothian / Waxahachie, Mid-Way Regional Airport', 'KJWY', false, [(0.5664611473274288, -1.691437359323684)], @a(dd) [])>)>]"; delete-storage = true;
}; forcepoweroff = false;
"org/gnome/shell/window-switcher" = { };
app-icon-mode = "both"; "org/virt-manager/virt-manager/details" = {
current-workspace-only = true; show-toolbar = true;
}; };
"org/gtk/settings/file-chooser" = { "org/virt-manager/virt-manager/connections" = {
location-mode = "path-bar"; autoconnect = [
show-hidden = false; "qemu:///session"
show-size-column = true; "qemu:///system"
sort-column = "modified"; ];
sort-directories-first = false; uris = [
sort-order = "descending"; "qemu:///session"
}; "qemu:///system"
"org/virt-manager/virt-manager/confirm" = { ];
delete-storage = true; };
forcepoweroff = false; };
}; }
"org/virt-manager/virt-manager/details" = { );
show-toolbar = true;
};
"org/virt-manager/virt-manager/connections" = {
autoconnect = [ "qemu:///session" "qemu:///system" ];
uris = [ "qemu:///session" "qemu:///system" ];
};
};
});
} }
+158 -77
View File
@@ -1,87 +1,168 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.greg.gui; cfg = config.greg.gui;
excludes = systems: opts: ( excludes = systems: opts: (if (builtins.all (x: pkgs.system != x) systems) then opts else [ ]);
if ( builtins.all (x: pkgs.system != x) systems ) then opts else []
);
# For now, we ignore this and don't install it vars = {
ffPkgs = pkgs.firefox.override { cfg.enableGnomeExtensions = true; }; XDG_CURRENT_DESKTOP = "GNOME";
};
in
{
options.greg.gui = lib.mkEnableOption "Enable GUI programs";
vars = { config = (
XDG_CURRENT_DESKTOP = "GNOME"; lib.mkIf cfg {
}; # These packages are Linux only
in { home.packages =
options.greg.gui = lib.mkEnableOption "Enable GUI programs"; with pkgs;
(excludes
[
"x86_64-darwin"
"aarch64-darwin"
]
[
cdrtools
element-desktop
freetube
qpwgraph
vlc
x265
]
)
++
config = (lib.mkIf cfg { # x86_64-linux only
# These packages are Linux only (excludes
home.packages = with pkgs; ( excludes ["x86_64-darwin" "aarch64-darwin"] [
[ "x86_64-darwin"
cdrtools "aarch64-darwin"
element-desktop "aarch64-linux"
freetube ]
qpwgraph [
vlc bitwarden
x265 discord
]) ++ endeavour
gnucash
jellyfin-media-player
#logseq
nextcloud-client
slack
]
)
++
# x86_64-linux only # Items that are not supported on ARM/Linux
( excludes ["x86_64-darwin" "aarch64-darwin" "aarch64-linux"] (excludes [ "aarch64-linux" ] [
[ onlyoffice-bin
bitwarden synology-drive-client
discord zoom-us
endeavour ]);
gnucash
jellyfin-media-player
#logseq
nextcloud-client
slack
]) ++
# Items that are not supported on ARM/Linux programs.firefox = {
( excludes ["aarch64-linux"] enable = (!pkgs.stdenv.hostPlatform.isDarwin);
[ package = pkgs.firefox-bin;
onlyoffice-bin policies = {
synology-drive-client DisableAppUpdate = true;
zoom-us };
]); profiles = {
default = {
bookmarks = import ./gui/bookmarks.nix;
id = 0;
isDefault = true;
search = {
default = "DuckDuckGo";
force = true;
engines = {
Google.metaData.alias = "@g";
"Nix Packages" = {
urls = [
{
template = "https://search.nixos.org/packages";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"Nix Options" = {
urls = [
{
template = "https://search.nixos.org/options";
params = [
{
name = "type";
value = "packages";
}
{
name = "query";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@no" ];
};
"Noogle" = {
urls = [
{
template = "https://noogle.dev/q";
params = [
{
name = "term";
value = "{searchTerms}";
}
];
}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@nl" ];
};
};
};
settings = {
"app.update.auto" = false;
"browser.ctrlTab.sortByRecentlyUsed" = true;
"browser.startup.page" = 3;
"browser.startup.homepage" = "https://thehellings.com";
"doh-rollout.doorhanger-decision" = "UIDisabled";
"doh-rollout.doneFirstRun" = true;
"signon.rememberSignons" = false;
};
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
bitwarden
gsconnect
foxyproxy-standard
multi-account-containers
octotree
okta-browser-plugin
refined-github
tree-style-tab
ublock-origin
];
};
};
};
programs.firefox = { # This is supposed to be in support of Firefox, but I dunno...
enable = (! pkgs.stdenv.hostPlatform.isDarwin); programs.bash.sessionVariables = vars;
package = ffPkgs; programs.xonsh.sessionVariables = vars;
profiles = { }
default = { );
isDefault = true;
id = 0;
search.default = "DuckDuckGo";
settings = {
"app.update.auto" = false;
"browser.ctrlTab.sortByRecentlyUsed" = true;
"browser.startup.page" = 3;
"browser.startup.homepage" = "https://thehellings.com";
"doh-rollout.doorhanger-decision" = "UIDisabled";
"doh-rollout.doneFirstRun" = true;
"signon.rememberSignons" = false;
};
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
bitwarden
gsconnect
foxyproxy-standard
multi-account-containers
octotree
refined-github
tree-style-tab
ublock-origin
];
};
};
};
# This is supposed to be in support of Firefox, but I dunno...
programs.bash.sessionVariables = vars;
programs.xonsh.sessionVariables = vars;
});
} }
+209
View File
@@ -0,0 +1,209 @@
[
{
name = "Toolbar";
toolbar = true;
bookmarks = [
{
name = "Ansible";
bookmarks = [
{
name = "Collection Index";
url = "https://docs.ansible.com/ansible/latest/collections/index.html";
}
];
}
{
name = "Church";
bookmarks = [
{
name = "DC4K";
url = "https://www.dc4k.org/leaderzone/articles";
}
];
}
{
name = "IVR";
bookmarks = [
{
name = "Dev";
bookmarks = [
{
name = "Core Survey";
url = "https://webdev5.ivrtechnology.com/coreservices/survey/admin/";
}
{
name = "Audio";
url = "https://apidev1.ivrtechnology.com/coreservices/audio/admin/";
}
{
name = "Tower";
url = "https://towerrd1.ivrtechnology.com";
}
];
}
{
name = "HC";
bookmarks = [
{
name = "Audio";
url = "https://hcweb3.ivrtechnology.com/coreservices/audio/admin/";
}
{
name = "Survey";
url = "https://hcweb2.ivrtechnology.com/coreservices/survey/admin/";
}
];
}
{
name = "PCI";
bookmarks = [
{
name = "Audio";
url = "https://pciweb3.ivrtechnology.com/coreservices/audio/admin/";
}
];
}
{
name = "Processes";
bookmarks = [
{
name = "Change Management";
url = "https://ivrtg.atlassian.net/wiki/spaces/ITS/pages/13094842/Executing+Change+Management";
}
{
name = "Okta";
url = "https://engagesmart.okta.com/";
}
{
name = "DB Request";
url = "https://ivrtg.aha.io/develop/features/INFR-1073";
}
{
name = "Server list";
url = "https://ivrtg.atlassian.net/wiki/spaces/ITS/pages/13009166/350+Main";
}
];
}
];
}
{
name = "Katie";
bookmarks = [
{
name = "Sports Forms";
url = "https://midlothianisd.rankone.com/New/NewStudentList.aspx";
}
{
name = "Skyward";
url = "https://skyward.iscorp.com/MidlothianISDTXStuSTS/Session/Signin?area=Home&controller=Home&action=Index&logoutreason=TimedOut";
}
];
}
{
name = "Nix";
bookmarks = [
{
name = "Package Versions";
url = "https://lazamar.co.uk/nix-versions/?channel=nixpkgs-unstable&package=python3";
}
{
name = "Channel status";
url = "https://status.nixos.org/";
}
{
name = "Home Manager options";
url = "https://nix-community.github.io/home-manager/options.xhtml";
}
{
name = "Flake Parts";
url = "https://community.flake.parts/";
}
{
name = "Language ref";
url = "https://nix.dev/manual/nix/latest/language/index.html";
}
{
name = "Builtin functions";
url = "https://nix.dev/manual/nix/latest/language/builtins.html";
}
{
name = "Nixpkgs functions";
url = "https://ryantm.github.io/nixpkgs/functions/library/strings/#sec-functions-library-strings";
}
{
name = "Noogle";
url = "https://noogle.dev/";
}
{
name = "NUR search";
url = "https://nur.nix-community.org/";
}
];
}
{
name = "Rust";
bookmarks = [
{
name = "Learn Rust";
url = "https://www.rust-lang.org/learn";
}
{
name = "Rust by Example";
url = "https://doc.rust-lang.org/rust-by-example/hello.html";
}
{
name = "Iced";
url = "https://docs.rs/iced/latest/iced/";
}
];
}
{
name = "Shopping";
bookmarks = [
{
name = "Cables";
url = "https://www.pchcables.com";
}
];
}
{
name = "SubTo";
bookmarks = [
{
name = "Kajabi";
url = "https://www.subtocourse.com/login";
}
{
name = "SubTo Fund";
url = "https://frontend.koreconx.com/auth/login";
}
{
name = "Creive Title";
url = "https://getcreativetitle.com/";
}
{
name = "REI Scripts";
url = "https://reiconveyorbelt.com/no-excuses/";
}
];
}
{
name = "Tools";
bookmarks = [
{
name = "Password Hash";
url = "https://unix4lyfe.org/crypt/";
}
{
name = "Keymap editor";
url = "https://nickcoutsos.github.io/keymap-editor/";
}
{
name = "Bitcoin dashboard";
url = "http://hosea.home:60845";
}
];
}
];
}
]
+12 -7
View File
@@ -1,10 +1,15 @@
{ config, pkgs, lib, ... }:
{ {
options.greg.pypackage = lib.mkOption { config,
description = "Enable Gnome support and settings"; pkgs,
type = lib.types.package; lib,
default = pkgs.gregpy; ...
}; }:
{
options.greg.pypackage = lib.mkOption {
description = "Enable Gnome support and settings";
type = lib.types.package;
default = pkgs.gregpy;
};
config.home.packages = [ config.greg.pypackage ]; config.home.packages = [ config.greg.pypackage ];
} }
+108 -96
View File
@@ -1,103 +1,115 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.greg.sway; cfg = config.greg.sway;
file_browser = { file_browser = {
pkg = pkgs.krusader; pkg = pkgs.krusader;
path = "${pkgs.krusader}/bin/krusader"; path = "${pkgs.krusader}/bin/krusader";
}; };
term = "${pkgs.alacritty}/bin/alacritty"; term = "${pkgs.alacritty}/bin/alacritty";
msg = "${pkgs.sway}/bin/swaymsg"; msg = "${pkgs.sway}/bin/swaymsg";
sleep = "${pkgs.coreutils}/bin/sleep"; sleep = "${pkgs.coreutils}/bin/sleep";
workstation1 = pkgs.writeScriptBin "workstation1" (builtins.concatStringsSep "\n" [ workstation1 = pkgs.writeScriptBin "workstation1" (
"${msg} \"workspace 1 ; exec ${pkgs.firefox}/bin/firefox ; split horizontal ; exec ${pkgs.element-desktop}/bin/element-desktop \"" builtins.concatStringsSep "\n" [
"${sleep} 1" "${msg} \"workspace 1 ; exec ${pkgs.firefox}/bin/firefox ; split horizontal ; exec ${pkgs.element-desktop}/bin/element-desktop \""
"${msg} '[app_id=\"firefox\"]' move left" "${sleep} 1"
"${msg} '[instance=\"element\"]' \"layout tabbed ; exec ${term} \"" "${msg} '[app_id=\"firefox\"]' move left"
"${msg} '[app_id=\"firefox\"]' move left" "${msg} '[instance=\"element\"]' \"layout tabbed ; exec ${term} \""
"${sleep} 0.3" "${msg} '[app_id=\"firefox\"]' move left"
"${msg} '[app_id=\"Alacritty\" workspace=\"1\"]' move right" "${sleep} 0.3"
"${msg} '[app_id=\"firefox\"]' resize grow width 300 px" "${msg} '[app_id=\"Alacritty\" workspace=\"1\"]' move right"
]); "${msg} '[app_id=\"firefox\"]' resize grow width 300 px"
workstation2 = pkgs.writeScriptBin "workstation2" (builtins.concatStringsSep "\n" [ ]
"${sleep} 5" );
"${msg} \"workspace 2 ; exec ${term} ; layout tabbed\"" workstation2 = pkgs.writeScriptBin "workstation2" (
]); builtins.concatStringsSep "\n" [
in { "${sleep} 5"
options.greg.sway = lib.mkEnableOption "Enable Sway support and settings"; "${msg} \"workspace 2 ; exec ${term} ; layout tabbed\""
]
);
in
{
options.greg.sway = lib.mkEnableOption "Enable Sway support and settings";
config = (lib.mkIf cfg { config = (
programs.swaylock.enable = true; lib.mkIf cfg {
programs.swaylock.enable = true;
wayland.windowManager.sway = let wayland.windowManager.sway =
mod = config.wayland.windowManager.sway.config.modifier; let
in { mod = config.wayland.windowManager.sway.config.modifier;
enable = true; in
config = rec { {
#fonts.size = 10.0; enable = true;
keybindings = lib.mkOptionDefault { config = rec {
"Mod4+l" = "exec ${pkgs.swaylock}/bin/swaylock -c 000000"; #fonts.size = 10.0;
"Mod4+h" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/headphones.qpwgraph -m"; keybindings = lib.mkOptionDefault {
"Mod4+m" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/monitor.qpwgraph -m"; "Mod4+l" = "exec ${pkgs.swaylock}/bin/swaylock -c 000000";
"Mod4+b" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/both.qpwgraph -m"; "Mod4+h" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/headphones.qpwgraph -m";
"Mod4+m" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/monitor.qpwgraph -m";
"Mod4+b" = "exec ${pkgs.qpwgraph}/bin/qpwgraph -x /home/greg/sound/both.qpwgraph -m";
"${mod}+Shift+Return" = file_browser.path; "${mod}+Shift+Return" = file_browser.path;
}; };
modifier = "Mod1"; modifier = "Mod1";
output = { output = {
"Samsung Electric Company S24E650 H4ZN600985" = { "Samsung Electric Company S24E650 H4ZN600985" = {
mode = "1920x1200"; mode = "1920x1200";
transform = "90"; transform = "90";
pos = "0 0"; pos = "0 0";
}; };
"ViewSonic Corporation VA2252 Series VMT201800925" = { "ViewSonic Corporation VA2252 Series VMT201800925" = {
mode = "1920x1080"; mode = "1920x1080";
pos = "200 1920"; pos = "200 1920";
}; };
}; };
terminal = term; terminal = term;
startup = [ startup = [
{ command = "${workstation1}/bin/workstation1"; } { command = "${workstation1}/bin/workstation1"; }
{ command = "${workstation2}/bin/workstation2"; } { command = "${workstation2}/bin/workstation2"; }
]; ];
}; };
extraOptions = [ extraOptions = [ "--unsupported-gpu" ];
"--unsupported-gpu" extraSessionCommands = ''
]; export WLR_NO_HARDWARE_CURSORS=1
extraSessionCommands = '' '';
export WLR_NO_HARDWARE_CURSORS=1 systemd.enable = true;
''; wrapperFeatures = {
systemd.enable = true; base = true;
wrapperFeatures = { gtk = true;
base = true; };
gtk = true; };
};
};
home.pointerCursor = {
name = "Adwaita";
package = pkgs.gnome.adwaita-icon-theme;
size = 12;
x11 = {
enable = true;
defaultCursor = "Adwaita";
};
};
home.packages = with pkgs; [ home.pointerCursor = {
arj name = "Adwaita";
dpkg package = pkgs.gnome.adwaita-icon-theme;
kate size = 12;
kget x11 = {
krename enable = true;
file_browser.pkg defaultCursor = "Adwaita";
p7zip };
plocate };
rpm
qpwgraph home.packages = with pkgs; [
xorg.xev arj
xorg.xmodmap dpkg
xxdiff kate
]; kget
}); krename
file_browser.pkg
p7zip
plocate
rpm
qpwgraph
xorg.xev
xorg.xmodmap
xxdiff
];
}
);
} }
+58 -28
View File
@@ -1,33 +1,63 @@
{ pkgs, config, lib, ... }: {
pkgs,
config,
lib,
top,
...
}:
let let
cfg = config.greg.vscodium; cfg = config.greg.vscodium;
in { in
options.greg.vscodium = lib.mkEnableOption "Enable installation of VSCodium on the host"; {
options.greg.vscodium = lib.mkEnableOption "Enable installation of VSCodium on the host";
config = lib.mkIf cfg { config = lib.mkIf cfg {
home.packages = with pkgs; [ home.packages = with pkgs; [
buildifier buildifier
gopls gopls
]; nixd # nix language server
];
# An alternative editor to vim, when I need it for some things # An alternative editor to vim, when I need it for some things
programs.vscode = { programs.vscode = {
enable = true; enable = true;
package = pkgs.vscodium; package = pkgs.vscodium;
extensions = with pkgs.vscode-extensions; [ extensions = with top.vsext.extensions."${pkgs.stdenv.system}".vscode-marketplace; [
arrterian.nix-env-selector arrterian.nix-env-selector
asvetliakov.vscode-neovim asvetliakov.vscode-neovim
bungcip.better-toml batisteo.vscode-django
golang.go donjayamanne.python-environment-manager
jnoortheen.nix-ide golang.go
mkhl.direnv kevinrose.vsc-python-indent
ms-python.python jnoortheen.nix-ide
rust-lang.rust-analyzer mkhl.direnv
vscjava.vscode-java-test ms-python.python
vscjava.vscode-java-dependency njpwerner.autodocstring
vscjava.vscode-java-debug rust-lang.rust-analyzer
]; tamasfe.even-better-toml
}; vadimcn.vscode-lldb
}; vscjava.vscode-java-test
vscjava.vscode-java-dependency
vscjava.vscode-java-debug
wholroyd.jinja
];
userSettings = {
"direnv.restart.automatic" = true;
"direnv.path.executable" = (lib.getExe pkgs.direnv);
"extensions.autoUpdate" = false;
"extensions.experimental.affinity" = {
"asvetliakov.vscode-neovim" = 1;
};
"git.openRepositoryInParentFolders" = "always";
"search.exclude" = {
"**/.tox" = true;
};
"terminal.integrated.defaultProfile.linux" = "tmux";
"vscode-neovim.neovimInitVimPaths.darwin" = "~/.config/nvim/init.lua";
"vscode-neovim.neovimInitVimPaths.linux" = "~/.config/nvim/init.lua";
"workbench.settings.applyToAllProfiles" = [ "direnv.path.executable" ];
};
};
};
} }
+84 -78
View File
@@ -1,94 +1,100 @@
{ config, pkgs, lib, ... }: { config, lib, ... }:
let let
cfg = config.programs.xonsh; cfg = config.programs.xonsh;
in with lib; { in
options = { with lib;
programs.xonsh = { {
enable = mkEnableOption "Enable the xonsh program"; options = {
programs.xonsh = {
enable = mkEnableOption "Enable the xonsh program";
sessionVariables = mkOption { sessionVariables = mkOption {
type = types.attrs; type = types.attrs;
default = {}; default = { };
example = { XONSH_TRACE_SUBPROC = true; }; example = {
description = '' XONSH_TRACE_SUBPROC = true;
Environment variables that will be set for the Xonsh session. };
''; description = ''
}; Environment variables that will be set for the Xonsh session.
'';
};
aliases = mkOption { aliases = mkOption {
type = types.attrsOf types.str; type = types.attrsOf types.str;
default = {}; default = { };
example = literalExpression '' example = literalExpression ''
{ {
ll = "ls -l"; ll = "ls -l";
la = "ls -a"; la = "ls -a";
} }
''; '';
description = '' description = ''
An attribute set that maps aliases (the top level attribute names in An attribute set that maps aliases (the top level attribute names in
this option) to command strings or directly to build outputs. this option) to command strings or directly to build outputs.
''; '';
}; };
configHeader = mkOption { configHeader = mkOption {
type = types.lines; type = types.lines;
default = ""; default = "";
example = literalExpression '' example = literalExpression ''
import os import os
import sys import sys
''; '';
description = "An arbitrary string to put at the top of the config file"; description = "An arbitrary string to put at the top of the config file";
}; };
configFooter = mkOption { configFooter = mkOption {
type = types.lines; type = types.lines;
default = ""; default = "";
example = literalExpression '' example = literalExpression ''
def _some_method(args): def _some_method(args):
do_command() do_command()
some_other_thing() some_other_thing()
aliases['some_method'] = _some_method aliases['some_method'] = _some_method
''; '';
description = "An arbitrary string to put at the end of the config file"; description = "An arbitrary string to put at the end of the config file";
}; };
}; };
}; };
config = config =
let let
shortAliases = concatStringsSep "\n" ( shortAliases = concatStringsSep "\n" (mapAttrsToList (k: v: "aliases['${k}']=r'${v}'") cfg.aliases);
mapAttrsToList (k: v: "aliases['${k}']=r'${v}'") cfg.aliases
);
listToPythonList = let listToPythonList =
listInternals = args: let
concatStringsSep "\n" (map (v: "'${v}'") args); listInternals = args: concatStringsSep "\n" (map (v: "'${v}'") args);
in list: "[${listInternals list}]"; in
list: "[${listInternals list}]";
sessionVars = concatStringsSep "\n" ( sessionVars = concatStringsSep "\n" (
mapAttrsToList (k: v: mapAttrsToList (
if builtins.typeOf v == "string" then k: v:
"\$${k} = '${v}'" if builtins.typeOf v == "string" then
else if builtins.typeOf v == "list" then "\$${k} = '${v}'"
"\$${k} = ${listToPythonList}" else if builtins.typeOf v == "list" then
else if builtins.typeOf v == "int" then "\$${k} = ${listToPythonList}"
"\$${k} = ${toString v}" else if builtins.typeOf v == "int" then
else "" "\$${k} = ${toString v}"
) cfg.sessionVariables else
); ""
) cfg.sessionVariables
);
in mkIf cfg.enable { in
mkIf cfg.enable {
home.file.".xonshrc".text = '' home.file.".xonshrc".text = ''
${cfg.configHeader} ${cfg.configHeader}
${sessionVars} ${sessionVars}
${shortAliases} ${shortAliases}
${cfg.configFooter} ${cfg.configFooter}
''; '';
}; };
} }
+74 -63
View File
@@ -1,65 +1,76 @@
{ inputs, overlays, ... }: { top, overlays, ... }:
let let
wsl = args: (unstable (args // { extraMods = [ inputs.wsl.nixosModules.wsl ]; })); wsl = args: (unstable (args // { extraMods = [ top.wsl.nixosModules.wsl ]; }));
unstable = args: (machine (args // { unstable =
channel = inputs.nixunstable; args:
hm = inputs.hmunstable; (machine (
nixvim = inputs.nixvimunstable; args
})); // {
machine = { channel = top.nixunstable;
channel ? inputs.nixstable, hm = top.hmunstable;
extraMods ? [], nixvim = top.nixvimunstable;
name, }
system ? "x86_64-linux", ));
hm ? inputs.hm, machine =
nixvim ? inputs.nixvimstable, {
}: channel ? top.nixstable,
let extraMods ? [ ],
nixpkgs = import channel { name,
inherit system; system ? "x86_64-linux",
}; hm ? top.hm,
# Use this to include modules directly from a repo nixvim ? top.nixvimstable,
nurNoPkg = import inputs.nurpkgs { }:
nurpkgs = nixpkgs; let
}; nixpkgs = import channel { inherit system; };
in channel.lib.nixosSystem { in
inherit system; channel.lib.nixosSystem {
specialArgs = { inherit nixpkgs inputs overlays; }; inherit system;
modules = [ specialArgs = {
{ inherit nixpkgs top overlays;
nixpkgs.overlays = overlays; inherit (top) self;
home-manager = { };
useGlobalPkgs = true; modules = [
useUserPackages = true; {
users.greg = import ../home/home.nix; nixpkgs.overlays = overlays;
extraSpecialArgs = { home-manager = {
inherit inputs overlays nixvim; useGlobalPkgs = true;
home = "/home/greg"; useUserPackages = true;
host = name; users.greg = import ../home/home.nix;
}; extraSpecialArgs = {
backupFileExtension = "bkp"; inherit top overlays nixvim;
}; home = "/home/greg";
} host = name;
inputs.agenix.nixosModules.default };
hm.nixosModules.home-manager backupFileExtension = "bkp";
inputs.self.modules.nixosModule };
inputs.nurpkgs.nixosModules.nur }
./${name} top.agenix.nixosModules.default
] ++ extraMods; hm.nixosModules.home-manager
}; top.self.modules.nixosModule
in { top.nurpkgs.nixosModules.nur
genesis = machine { name = "genesis"; }; ./${name}
exodus = unstable { name = "exodus"; }; ] ++ extraMods;
jude = unstable { name = "jude"; }; };
icdm-root = unstable { name = "icdm-root"; }; in
linode = machine { name = "linode"; }; {
hosea = unstable { name = "hosea"; }; genesis = machine { name = "genesis"; };
jeremiah = unstable { name = "jeremiah"; }; exodus = unstable { name = "exodus"; };
myself = unstable { name = "myself"; }; jude = unstable { name = "jude"; };
iso = machine { name = "iso"; }; icdm-root = unstable { name = "icdm-root"; };
iso-beta = unstable { name = "iso"; }; linode = machine { name = "linode"; };
# nix build '.#nixosConfigurations.wsl.config.system.build.installer' hosea = unstable { name = "hosea"; };
nixos = wsl { name = "wsl"; system = "aarch64-linux"; }; jeremiah = unstable { name = "jeremiah"; };
# nix build '.#nixosConfigurations.wsl-aarch.config.system.build.installer' myself = unstable { name = "myself"; };
nixos-arm = wsl { name = "wsl"; system = "aarch64-linux"; }; iso = machine { name = "iso"; };
iso-beta = unstable { name = "iso"; };
# nix build '.#nixosConfigurations.wsl.config.system.build.installer'
nixos = wsl {
name = "wsl";
system = "aarch64-linux";
};
# nix build '.#nixosConfigurations.wsl-aarch.config.system.build.installer'
nixos-arm = wsl {
name = "wsl";
system = "aarch64-linux";
};
} }
+25 -19
View File
@@ -1,24 +1,30 @@
{ pkgs, config, ... }: { config, ... }:
{ {
imports = [ imports = [ ./hardware-configuration.nix ];
./hardware-configuration.nix
../jude/printing.nix
];
boot.loader = { boot = {
systemd-boot.enable = true; loader = {
efi.canTouchEfiVariables = true; systemd-boot.enable = true;
}; efi.canTouchEfiVariables = true;
};
binfmt.emulatedSystems = [
"i686-linux"
"aarch64-linux"
];
};
networking.hostName = "exodus"; nix.settings.extra-platforms = config.boot.binfmt.emulatedSystems;
greg = {
home = true; networking.hostName = "exodus";
gnome.enable = true; greg = {
tailscale.enable = true; home = true;
vmdev = { gnome.enable = true;
enable = true; print.enable = true;
system = "intel"; tailscale.enable = true;
}; vmdev = {
}; enable = true;
system = "intel";
};
};
} }
+23 -14
View File
@@ -1,28 +1,37 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "uas" "sd_mod" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"thunderbolt"
"nvme"
"uas"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/607b933f-2967-4652-b478-4d8e9aa38a0d"; device = "/dev/disk/by-uuid/607b933f-2967-4652-b478-4d8e9aa38a0d";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@" ]; options = [ "subvol=@" ];
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/B31C-C1F4"; device = "/dev/disk/by-uuid/B31C-C1F4";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ ]; swapDevices = [ ];
+72 -59
View File
@@ -1,62 +1,75 @@
{ pkgs, config, lib, ... }: {
pkgs,
config,
lib,
...
}:
let let
address = (builtins.elemAt config.networking.interfaces.ens18.ipv4.addresses 0).address; address = (builtins.elemAt config.networking.interfaces.ens18.ipv4.addresses 0).address;
root_ca = pkgs.writeText "root_ca.crt" (builtins.readFile ../../ca/root_ca.crt); root_ca = pkgs.writeText "root_ca.crt" (builtins.readFile ../../ca/root_ca.crt);
intermediate_ca = pkgs.writeText "intermediate_ca.crt" (builtins.readFile ../../ca/intermediate_ca.crt); intermediate_ca = pkgs.writeText "intermediate_ca.crt" (
in { builtins.readFile ../../ca/intermediate_ca.crt
age.secrets.acme_password = { );
file = ../../secrets/acme_password.age; in
}; {
age.secrets.intermediate_ca_key = { age.secrets.acme_password = {
file = ../../secrets/ca/intermediate_key.age; file = ../../secrets/acme_password.age;
}; };
age.secrets.root_ca_key.file = ../../secrets/ca/root_key.age; age.secrets.intermediate_ca_key = {
systemd.services.step-ca.serviceConfig.Environment = lib.mkForce ["STEPDEBUG=1" "HOME=%S/step-ca"]; file = ../../secrets/ca/intermediate_key.age;
services.step-ca = { };
inherit address; age.secrets.root_ca_key.file = ../../secrets/ca/root_key.age;
enable = false; systemd.services.step-ca.serviceConfig.Environment = lib.mkForce [
intermediatePasswordFile = config.age.secrets.acme_password.path; "STEPDEBUG=1"
openFirewall = true; "HOME=%S/step-ca"
port = 8443; ];
settings = { services.step-ca = {
root = root_ca; inherit address;
federatedRoots = null; enable = false;
cert = intermediate_ca; intermediatePasswordFile = config.age.secrets.acme_password.path;
key = config.age.secrets.intermediate_ca_key.path; openFirewall = true;
dnsNames = [ port = 8443;
"10.42.1.5" settings = {
"acme.thehellings.lan" root = root_ca;
]; federatedRoots = null;
logger.format = "text"; cert = intermediate_ca;
db = { key = config.age.secrets.intermediate_ca_key.path;
type = "badgerv2"; dnsNames = [
dataSource = "/var/lib/step-ca/db"; "10.42.1.5"
badgerFileLoadingMode = ""; "acme.thehellings.lan"
}; ];
authority.provisioners = [ { logger.format = "text";
type = "JWK"; db = {
name = "greg@thehellings.com"; type = "badgerv2";
key = { dataSource = "/var/lib/step-ca/db";
use = "sig"; badgerFileLoadingMode = "";
kty = "EC"; };
kid = "1GOpOttYLZtx7XiG79ZycbGcG4ptL0czfohK35SZOEI"; authority.provisioners = [
crv = "P-256"; {
alg = "ES256"; type = "JWK";
x = "YEWVj5CCoqWQXWqmL0UuORlFY9IEOLcg1jpG1o-wGx4"; name = "greg@thehellings.com";
y = "MEpqnJp60VV-SpFtb6m8U-VAYut7R_PKFm07xl7MjBk"; key = {
}; use = "sig";
encryptedKey = "eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjdHkiOiJqd2sranNvbiIsImVuYyI6IkEyNTZHQ00iLCJwMmMiOjYwMDAwMCwicDJzIjoieWdfb0lfbWgwbHhPRXdjUTBsd0FnUSJ9.ivdQUFEhs2U8PUBYr8AhQl3hHdb4spF4jvXgqY_hiVgpjB-z3Nn9Uw.u7vrNht_3WD1G97q.mbydlpAQxjtKLkOmmDOUczqscRDPqrUyoPJ1uqXcJDH3vs4KiYlrKRcFLjPy9sWzEL1iIrqjwf3U-3AAx1KNAg7frs2D__MGfOO-U5SdQDVJVAND7KpWOJGJVSb0xioCA6-8ldlP_REqu4ENmkkdw0_6Is2b0p7ZFKqke_fqOOs7osqFAfbMb_WzEWrACLn5A5-Teh2rpEgR-z9zipN6MSEqE6VIQ2BXuv70aHWhslNe1MK1OgTYm9CqA47EMYvQ7HQLPDZAbP56WK84yJLktoXMmnkaKeTtvER0dh4ufyjJHBhecnEranbR5rHc_jV8_qvyWhlqbCrOU_8bWrk.a9SH_q3GKIUsOUSRWkDxQg"; kty = "EC";
} ]; kid = "1GOpOttYLZtx7XiG79ZycbGcG4ptL0czfohK35SZOEI";
tls = { crv = "P-256";
cipherSuites = [ alg = "ES256";
"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256" x = "YEWVj5CCoqWQXWqmL0UuORlFY9IEOLcg1jpG1o-wGx4";
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" y = "MEpqnJp60VV-SpFtb6m8U-VAYut7R_PKFm07xl7MjBk";
]; };
minVersion = 1.2; encryptedKey = "eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjdHkiOiJqd2sranNvbiIsImVuYyI6IkEyNTZHQ00iLCJwMmMiOjYwMDAwMCwicDJzIjoieWdfb0lfbWgwbHhPRXdjUTBsd0FnUSJ9.ivdQUFEhs2U8PUBYr8AhQl3hHdb4spF4jvXgqY_hiVgpjB-z3Nn9Uw.u7vrNht_3WD1G97q.mbydlpAQxjtKLkOmmDOUczqscRDPqrUyoPJ1uqXcJDH3vs4KiYlrKRcFLjPy9sWzEL1iIrqjwf3U-3AAx1KNAg7frs2D__MGfOO-U5SdQDVJVAND7KpWOJGJVSb0xioCA6-8ldlP_REqu4ENmkkdw0_6Is2b0p7ZFKqke_fqOOs7osqFAfbMb_WzEWrACLn5A5-Teh2rpEgR-z9zipN6MSEqE6VIQ2BXuv70aHWhslNe1MK1OgTYm9CqA47EMYvQ7HQLPDZAbP56WK84yJLktoXMmnkaKeTtvER0dh4ufyjJHBhecnEranbR5rHc_jV8_qvyWhlqbCrOU_8bWrk.a9SH_q3GKIUsOUSRWkDxQg";
maxVersion = 1.3; }
renegotiation = false; ];
}; tls = {
}; cipherSuites = [
}; "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"
];
minVersion = 1.2;
maxVersion = 1.3;
renegotiation = false;
};
};
};
} }
+38 -39
View File
@@ -2,47 +2,46 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }: { pkgs, ... }:
{ {
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./acme.nix ./acme.nix
./hardware-configuration.nix ./hardware-configuration.nix
./home-assistant.nix ./home-assistant.nix
./networking.nix ./networking.nix
]; ];
greg.home = true;
greg.gnome.enable = false;
# Bootloader.
boot.loader.grub = {
enable = true;
device = "/dev/vda";
useOSProber = true;
};
#boot.loader = { greg.home = true;
# systemd-boot.enable = true; greg.gnome.enable = false;
# efi = {
# canTouchEfiVariables = true;
# efiSysMountPoint = "/boot/efi";
# };
#};
networking.hostName = "genesis"; # Define your hostname.
environment.systemPackages = with pkgs; [
awscli2
btrfs-progs
create_ssl
step-ca
];
virtualisation.oci-containers.containers.speedtest = { # Bootloader.
image = "ghcr.io/librespeed/speedtest"; boot.loader.grub = {
hostname = "speedtest"; enable = true;
ports = [ "19472:80" ]; device = "/dev/vda";
}; useOSProber = true;
greg.proxies."speedtest.thehellings.lan".target = "http://localhost:19472"; };
#boot.loader = {
# systemd-boot.enable = true;
# efi = {
# canTouchEfiVariables = true;
# efiSysMountPoint = "/boot/efi";
# };
#};
networking.hostName = "genesis"; # Define your hostname.
environment.systemPackages = with pkgs; [
awscli2
create_ssl
step-ca
];
virtualisation.oci-containers.containers.speedtest = {
image = "ghcr.io/librespeed/speedtest";
hostname = "speedtest";
ports = [ "19472:80" ];
};
greg.proxies."speedtest.thehellings.lan".target = "http://localhost:19472";
} }
+14 -12
View File
@@ -1,26 +1,28 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { lib, modulesPath, ... }:
{ {
imports = imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"sr_mod"
"virtio_blk"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/a13f941e-4985-47ab-a8c6-374a627c5ce1"; device = "/dev/disk/by-uuid/a13f941e-4985-47ab-a8c6-374a627c5ce1";
fsType = "ext4"; fsType = "ext4";
}; };
swapDevices = swapDevices = [ { device = "/dev/disk/by-uuid/ac4557de-1ad5-4d3c-b9f4-5ec50dbf76f1"; } ];
[ { device = "/dev/disk/by-uuid/ac4557de-1ad5-4d3c-b9f4-5ec50dbf76f1"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's
+129 -123
View File
@@ -1,137 +1,143 @@
{ config, pkgs, ... }: { pkgs, ... }:
let
service_list = [ "podman-home-assistant.service" ];
in
{ {
virtualisation.podman.enable = true; virtualisation.podman.enable = true;
services.home-assistant = { services.home-assistant = {
enable = true; enable = true;
configDir = "/var/lib/hass"; configDir = "/var/lib/hass";
package = (pkgs.home-assistant.override { extraComponents = [
extraComponents = [ "accuweather"
"accuweather" "calendar"
"calendar" "cast"
"cast" "eufy"
"eufy" "lovelace"
"lovelace" "nextcloud"
"nextcloud" "ping"
"ping" "piper"
"piper" "radio_browser"
"radio_browser" "rainbird"
"rainbird" "roborock"
"roborock" "smart_meter_texas"
"smart_meter_texas" "speedtestdotnet"
"speedtestdotnet" "solaredge"
"solaredge" "whisper"
"tplink" "wiz"
"whisper" "wyoming"
"wiz" "zwave_js"
"wyoming" ];
"zwave_js" customComponents = with pkgs.home-assistant-custom-components; [ smartthinq-sensors ];
];
}).overrideAttrs (oldAttrs: {
doInstallCheck = false;
});
config = { config = {
default_config = {}; default_config = { };
tts = [ { platform = "google_translate"; } ]; tts = [ { platform = "google_translate"; } ];
http = { http = {
use_x_forwarded_for = true; use_x_forwarded_for = true;
trusted_proxies = [ "127.0.0.1" "::1" ]; trusted_proxies = [
server_host = "127.0.0.1"; "127.0.0.1"
}; "::1"
#"automation manual" = *nix config here* and so on ];
"automation ui" = "!include automations.yaml"; server_host = "127.0.0.1";
"script ui" = "!include scripts.yaml"; };
"scene ui" = "!include scenes.yaml"; #"automation manual" = *nix config here* and so on
}; "automation ui" = "!include automations.yaml";
}; "script ui" = "!include scripts.yaml";
"scene ui" = "!include scenes.yaml";
};
};
# Helps with Voice stuff for Home Assistant # Helps with Voice stuff for Home Assistant
services.wyoming = { services.wyoming = {
faster-whisper.servers = { faster-whisper.servers = {
greg = { greg = {
enable = true; enable = true;
beamSize = 1; # wut? beamSize = 1; # wut?
device = "auto"; # Could be CPU or CUDA device = "auto"; # Could be CPU or CUDA
language = "en"; language = "en";
model = "base-int8"; model = "base-int8";
uri = "tcp://0.0.0.0:13415"; uri = "tcp://0.0.0.0:13415";
}; };
}; };
piper.servers.greg = { piper.servers.greg = {
enable = true; enable = true;
uri = "tcp://0.0.0.0:13416"; uri = "tcp://0.0.0.0:13416";
voice = "en_US-amy-medium"; voice = "en_US-amy-medium";
}; };
}; };
# Although NixOS has a package for Home Assistant, it is not kept as up to date as the container and the upstream # Although NixOS has a package for Home Assistant, it is not kept as up to date as the container and the upstream
# is very vocal about only supporting their own container or the HAOS deployments. So we deploy the container here # is very vocal about only supporting their own container or the HAOS deployments. So we deploy the container here
# and avoid any potential messes from that # and avoid any potential messes from that
virtualisation.oci-containers = { virtualisation.oci-containers = {
backend = "podman"; backend = "podman";
# I have ZWave devices. The easiest way to connect to them is the zwavejs2mqtt service running, so we spin up # I have ZWave devices. The easiest way to connect to them is the zwavejs2mqtt service running, so we spin up
# its container and map the ZWave device into it # its container and map the ZWave device into it
containers.zwave = { containers.zwave = {
autoStart = false; # We will try to start it with udev.extraRules listed below, as this option starts it too quickly autoStart = false; # We will try to start it with udev.extraRules listed below, as this option starts it too quickly
image = "zwavejs/zwave-js-ui:latest"; image = "zwavejs/zwave-js-ui:latest";
ports = [ "8091:8091" "3000:3000" ]; ports = [
volumes = [ "/var/lib/zwave:/usr/src/app/store" ]; "8091:8091"
extraOptions = [ "3000:3000"
"--device" "/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave" ];
"--pull=newer" volumes = [ "/var/lib/zwave:/usr/src/app/store" ];
]; extraOptions = [
environment = { "--device"
TZ = "America/Chicago"; "/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave"
CONSOLE_OUTPUT = "true"; "--pull=newer"
}; ];
}; environment = {
}; TZ = "America/Chicago";
CONSOLE_OUTPUT = "true";
};
};
};
# Both of the above container need storage for their configuration and devices, but it is not created correctly by # Both of the above container need storage for their configuration and devices, but it is not created correctly by
# the container. So we add the creation of /var/lib/{zwave,hass} to the systemd Unit files # the container. So we add the creation of /var/lib/{zwave,hass} to the systemd Unit files
systemd.services = { systemd.services = {
"podman-zwave" = { "podman-zwave" = {
after = [ "sys-devices-pci0000:00-0000:00:1e.0-0000:02:1b.0-usb2-2\\x2d1-2\\x2d1:1.0-tty-ttyACM0.device" ]; after = [
wantedBy = [ "sys-devices-pci0000:00-0000:00:1e.0-0000:02:1b.0-usb2-2\\x2d1-2\\x2d1:1.0-tty-ttyACM0.device" ]; "sys-devices-pci0000:00-0000:00:1e.0-0000:02:1b.0-usb2-2\\x2d1-2\\x2d1:1.0-tty-ttyACM0.device"
serviceConfig = { ];
StateDirectory = "zwave"; wantedBy = [
StateDirectoryMode = pkgs.lib.mkForce "0777"; "sys-devices-pci0000:00-0000:00:1e.0-0000:02:1b.0-usb2-2\\x2d1-2\\x2d1:1.0-tty-ttyACM0.device"
}; ];
}; serviceConfig = {
}; StateDirectory = "zwave";
StateDirectoryMode = pkgs.lib.mkForce "0777";
};
};
};
services.udev.extraRules = '' services.udev.extraRules = ''
SUBSYSTEM=="tty", KERNEL=="ttyACM0", TAG+="systemd" SUBSYSTEM=="tty", KERNEL=="ttyACM0", TAG+="systemd"
''; '';
greg.proxies = {
"smart.home".target = "http://127.0.0.1:8123/";
"smart.thehellings.lan".target = "http://127.0.0.1:8123/";
"zwave.home".target = "http://127.0.0.1:8091/";
};
greg.proxies = { # Ensure that both ports are up and running. We keep 8123 directly open because we are on the LAN and sometimes want to connect
"smart.home".target = "http://127.0.0.1:8123/"; # directly for troubleshooting Nginx configuration
"smart.thehellings.lan".target = "http://127.0.0.1:8123/"; networking.firewall = {
"zwave.home".target = "http://127.0.0.1:8091/"; allowedTCPPorts = [
}; 80
443
];
};
# Ensure that both ports are up and running. We keep 8123 directly open because we are on the LAN and sometimes want to connect greg.backup.jobs.zwave = {
# directly for troubleshooting Nginx configuration src = "/var/lib/zwave";
networking.firewall = { dest = "zwave";
allowedTCPPorts = [ 80 443 ]; id = "zwave-asdf";
}; };
greg.backup.jobs.zwave = { greg.backup.jobs.hass-backup = {
src = "/var/lib/zwave"; src = "/var/lib/hass";
dest = "zwave"; dest = "hass";
id = "zwave-asdf"; id = "hass-asdf";
}; };
greg.backup.jobs.hass-backup = {
src = "/var/lib/hass";
dest = "hass";
id = "hass-asdf";
};
} }
+181 -174
View File
@@ -1,191 +1,198 @@
{ pkgs, config, ... }: { pkgs, ... }:
let let
lan = "ens18"; lan = "ens18";
lanIP = "10.42.1.5"; lanIP = "10.42.1.5";
iot = "ens19"; iot = "ens19";
iotIP = "192.168.66.250"; iotIP = "192.168.66.250";
routerIP = "10.42.1.2"; routerIP = "10.42.1.2";
extraHosts = builtins.readFile ./net/hosts; extraHosts = builtins.readFile ./net/hosts;
adblockUpdate = pkgs.writeShellScriptBin "adblockUpdate" (builtins.readFile ./adblockUpdate.sh); adblockUpdate = pkgs.writeShellScriptBin "adblockUpdate" (builtins.readFile ./adblockUpdate.sh);
proxyPort = 3128; proxyPort = 3128;
dnsPort = 53; dnsPort = 53;
dhcpPort = 67; dhcpPort = 67;
dnsServers = [ dnsServers = [
"9.9.9.9" # Quad 9 "9.9.9.9" # Quad 9
"1.1.1.1" # Cloudflare "1.1.1.1" # Cloudflare
"1.0.0.1" # Cloudflare "1.0.0.1" # Cloudflare
"149.112.112.112" # Quad 9 "149.112.112.112" # Quad 9
]; ];
in { in
greg.tailscale.enable = true; {
greg.tailscale.enable = true;
# Really, why do I still have to force-disable this crap? # Really, why do I still have to force-disable this crap?
boot.kernel.sysctl = { boot.kernel.sysctl = {
"net.ipv6.conf.${lan}.disable_ipv6" = true; "net.ipv6.conf.${lan}.disable_ipv6" = true;
"net.ipv6.conf.${iot}.disable_ipv6" = true; "net.ipv6.conf.${iot}.disable_ipv6" = true;
"net.ipv6.conf.lo.disable_ipv6" = true; "net.ipv6.conf.lo.disable_ipv6" = true;
}; };
networking = { networking = {
enableIPv6 = false; enableIPv6 = false;
networkmanager.enable = pkgs.lib.mkForce false; networkmanager.enable = pkgs.lib.mkForce false;
defaultGateway = routerIP; defaultGateway = routerIP;
nameservers = dnsServers; nameservers = dnsServers;
interfaces = { interfaces = {
# This is our LAN port # This is our LAN port
"${lan}" = { "${lan}" = {
useDHCP = false; useDHCP = false;
ipv4.addresses = [ { ipv4.addresses = [
address = "${lanIP}"; {
prefixLength = 16; address = "${lanIP}";
} ]; prefixLength = 16;
}; }
];
};
"${iot}" = { "${iot}" = {
useDHCP = false; useDHCP = false;
ipv4.addresses = [ { ipv4.addresses = [
address = "${iotIP}"; {
prefixLength = 24; address = "${iotIP}";
} ]; prefixLength = 24;
}; }
}; ];
firewall = { };
enable = false; };
allowedUDPPorts = [ firewall = {
dhcpPort enable = false;
dnsPort allowedUDPPorts = [
1900 # Jellyfin auto-discovery dhcpPort
7359 # Jellyfin auto-discovery dnsPort
]; 1900 # Jellyfin auto-discovery
allowedTCPPorts = [ 7359 # Jellyfin auto-discovery
dnsPort ];
proxyPort allowedTCPPorts = [
80 dnsPort
]; proxyPort
}; 80
nftables.enable = false; ];
}; };
nftables.enable = false;
};
environment.etc."hosts.d/local".text = extraHosts; environment.etc."hosts.d/local".text = extraHosts;
fileSystems = { fileSystems = {
"/media" = { "/media" = {
device = "10.42.1.4:/volume1/video/"; device = "10.42.1.4:/volume1/video/";
fsType = "nfs"; fsType = "nfs";
options = [ "ro" ]; options = [ "ro" ];
}; };
}; };
services = { services = {
# Video services # Video services
jellyfin = { jellyfin = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
}; };
######### #########
# Blind service proxy behind the walls of the VPN # Blind service proxy behind the walls of the VPN
######## ########
_3proxy = { _3proxy = {
enable = true; enable = true;
services = [ { services = [
type = "socks"; {
auth = [ "strong" ]; type = "socks";
bindPort = proxyPort; auth = [ "strong" ];
acl = [ { bindPort = proxyPort;
rule = "allow"; acl = [
users = [ "greg" ]; {
} ]; rule = "allow";
} ]; users = [ "greg" ];
#usersFile = "/run/agenix/3proxy"; }
denyPrivate = false; ];
}; }
];
#usersFile = "/run/agenix/3proxy";
denyPrivate = false;
};
######### #########
# dnsmasq config # dnsmasq config
######## ########
dnsmasq = { dnsmasq = {
enable = true; enable = true;
settings = { settings = {
domain = "thehellings.lan"; domain = "thehellings.lan";
dhcp-range = [ dhcp-range = [
"${lan},10.42.2.1,10.42.2.255,255.255.0.0,12h" "${lan},10.42.2.1,10.42.2.255,255.255.0.0,12h"
"${iot},192.168.66.3,192.168.66.150,255.255.255.0,12h" "${iot},192.168.66.3,192.168.66.150,255.255.255.0,12h"
"vlan67@${lan},192.168.67.3,192.168.67.150,12h" "vlan67@${lan},192.168.67.3,192.168.67.150,12h"
]; ];
dhcp-option = [ dhcp-option = [
"${lan},option:router,${routerIP}" "${lan},option:router,${routerIP}"
"${lan},option:dns-server,${lanIP},1.1.1.1" "${lan},option:dns-server,${lanIP},1.1.1.1"
"${lan},option:domain-search,thehellings.lan" "${lan},option:domain-search,thehellings.lan"
"${iot},option:router,192.168.66.1" "${iot},option:router,192.168.66.1"
"${iot},option:dns-server,${iotIP}" "${iot},option:dns-server,${iotIP}"
"vlan67@${lan},option:router,192.168.67.1" "vlan67@${lan},option:router,192.168.67.1"
"vlan67@${lan},option:dns-server,192.168.67.1" "vlan67@${lan},option:dns-server,192.168.67.1"
]; ];
dhcp-host = [ dhcp-host = [
# Static IPs for personal work # Static IPs for personal work
"2a:5d:23:10:4e:22,10.42.0.5" # SAN Switch "2a:5d:23:10:4e:22,10.42.0.5" # SAN Switch
"00:00:de:ad:be:ef,10.42.2.254" "00:00:de:ad:be:ef,10.42.2.254"
"01:a8:a1:59:c7:8a:12,10.42.2.253" # BMC management interface for isaiah "01:a8:a1:59:c7:8a:12,10.42.2.253" # BMC management interface for isaiah
# Static IPs for things in the IOT range # Static IPs for things in the IOT range
"b4:b0:24:9a:02:4a,192.168.66.5" # LD125 "b4:b0:24:9a:02:4a,192.168.66.5" # LD125
"98:da:c4:20:f3:64,192.168.66.6" # Dining room light "98:da:c4:20:f3:64,192.168.66.6" # Dining room light
"54:af:97:c1:dc:b9,192.168.66.25" # Master bedroom Kasa switch "54:af:97:c1:dc:b9,192.168.66.25" # Master bedroom Kasa switch
"f0:03:8c:b3:b0:f6,192.168.66.55" # Roomba "f0:03:8c:b3:b0:f6,192.168.66.55" # Roomba
"4c:a1:61:05:cd:52,192.168.66.61" # Rainbird "4c:a1:61:05:cd:52,192.168.66.61" # Rainbird
"48:d6:d5:5d:81:21,192.168.66.65" # Google Home "48:d6:d5:5d:81:21,192.168.66.65" # Google Home
"6c:29:90:3e:e2:02,192.168.66.66" # wiz "6c:29:90:3e:e2:02,192.168.66.66" # wiz
"28:87:ba:0e:ca:da,192.168.66.74" # "28:87:ba:0e:ca:da,192.168.66.74"
"28:87:ba:0e:c9:fd,192.168.66.75" # Master closet "28:87:ba:0e:c9:fd,192.168.66.75" # Master closet
"54:af:97:c2:0f:a1,192.168.66.76" # Master toilet "54:af:97:c2:0f:a1,192.168.66.76" # Master toilet
"54:af:97:83:ed:33,192.168.66.80" "54:af:97:83:ed:33,192.168.66.80"
"98:da:c4:77:80:18,192.168.66.84" # Kitchen lights "98:da:c4:77:80:18,192.168.66.84" # Kitchen lights
"98:da:c4:21:1b:2e,192.168.66.85" # Living Room lights "98:da:c4:21:1b:2e,192.168.66.85" # Living Room lights
"0c:80:63:41:6e:0f,192.168.66.90" # Front porch "0c:80:63:41:6e:0f,192.168.66.90" # Front porch
"0c:80:63:41:6c:5d,192.168.66.98" # House number "0c:80:63:41:6c:5d,192.168.66.98" # House number
"ac:84:c6:5e:4b:28,192.168.66.100" "ac:84:c6:5e:4b:28,192.168.66.100"
"98:da:c4:77:7f:4d,192.168.66.102" # Office lights "98:da:c4:77:7f:4d,192.168.66.102" # Office lights
"8c:85:80:1c:f9:d1,192.168.66.104" "8c:85:80:1c:f9:d1,192.168.66.104"
"98:da:c4:77:82:7b,192.168.66.105" # Parlor lamp "98:da:c4:77:82:7b,192.168.66.105" # Parlor lamp
"0c:80:63:41:74:73,192.168.66.106" # Front hall light switch "0c:80:63:41:74:73,192.168.66.106" # Front hall light switch
"98:da:c4:20:ea:db,192.168.66.107" # Parlor light switch "98:da:c4:20:ea:db,192.168.66.107" # Parlor light switch
"8c:49:62:aa:58:60,192.168.66.108" # Roku, HiHandsome "8c:49:62:aa:58:60,192.168.66.108" # Roku, HiHandsome
"92:3e:11:c7:c5:be,192.168.66.109" "92:3e:11:c7:c5:be,192.168.66.109"
"d8:0d:17:19:60:62,192.168.66.112" "d8:0d:17:19:60:62,192.168.66.112"
"b4:b0:24:9a:12:53,192.168.66.130" # KL125 "b4:b0:24:9a:12:53,192.168.66.130" # KL125
"b4:b0:24:9a:14:0e,192.168.66.131" "b4:b0:24:9a:14:0e,192.168.66.131"
"e4:f0:42:61:fa:b5,192.168.66.149" # Google Home-mini "e4:f0:42:61:fa:b5,192.168.66.149" # Google Home-mini
]; ];
expand-hosts = true; expand-hosts = true;
log-dhcp = true; log-dhcp = true;
log-queries = true; log-queries = true;
no-hosts = true; # Do not read /etc/hosts, which makes genesis resolve to 127.0.0.2 no-hosts = true; # Do not read /etc/hosts, which makes genesis resolve to 127.0.0.2
addn-hosts = "/etc/adblock_hosts"; addn-hosts = "/etc/adblock_hosts";
hostsdir = "/etc/hosts.d/"; hostsdir = "/etc/hosts.d/";
server = dnsServers; server = dnsServers;
}; };
}; };
# Update adblock list # Update adblock list
cron = { cron = {
enable = true; enable = true;
systemCronJobs = [ systemCronJobs = [ "* * * * * root ${adblockUpdate} 2>&1 > /var/log/adblock.log" ];
"* * * * * root ${adblockUpdate} 2>&1 > /var/log/adblock.log" };
]; }; # End of services configuration
};
}; # End of services configuration
greg.proxies = { greg.proxies = {
"jellyfin.home".target = "http://localhost:8096/"; "jellyfin.home".target = "http://localhost:8096/";
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
bind bind
curl # Used by dnsmasq fetching curl # Used by dnsmasq fetching
sqlite sqlite
]; ];
} }
+76
View File
@@ -0,0 +1,76 @@
{ config, pkgs, ... }:
let
ip = "100.68.203.1";
in
{
nix-bitcoin = {
generateSecrets = true;
operator = {
enable = true;
name = "greg";
};
useVersionLockedPkgs = true; # Use the exact versions of packages from upstream
};
networking.firewall.allowedTCPPorts = with config.services; [
bitcoind.port
bitcoind.rpc.port
lnd.restPort
lnd.port
mempool.frontend.port
];
greg.backup.jobs = {
clightning = {
src = config.services.clightning.replication.local.directory;
dest = "hosea-clightning";
id = "clightning";
};
};
services = {
backups = {
enable = true;
frequency = "hourly";
};
bitcoind = {
enable = true;
address = "0.0.0.0";
dataDir = "/chain/bitcoind";
listen = true;
rpc = {
address = ip;
allowip = [ "100.1.1.1/8" ];
};
};
clightning = {
enable = true;
address = ip;
port = 9736;
replication = {
enable = true;
local.directory = "/var/backup/clightning";
encrypt = false;
};
};
electrs = {
enable = true;
address = ip;
};
lnd = {
enable = true;
address = ip;
lndconnect.enable = true;
};
mempool = {
enable = true;
frontend = {
enable = true;
address = ip;
};
};
};
environment.systemPackages = with pkgs; [ ];
}
+51 -49
View File
@@ -2,60 +2,62 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, lib, inputs, overlays, ... }: { top, ... }:
let let
wanInterface = "enp2s0"; wanInterface = "enp2s0";
lanInterface = "enp1s0"; lanInterface = "enp1s0";
lanIpAddress = "10.42.1.7"; lanIpAddress = "10.42.1.7";
in in
{ {
imports = imports = [
[ # Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./minio.nix top.btc.nixosModules.default
]; ./bitcoin.nix
];
# Bootloader
boot = {
loader = {
systemd-boot.enable = true;
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/";
};
};
extraModprobeConfig = "vboxdrv";
};
users.users.greg.extraGroups = [ "vboxusers" ];
# Bootloader networking = {
boot = { hostName = "hosea";
loader = { nameservers = [ "10.42.1.5" ];
systemd-boot.enable = true; defaultGateway = "10.42.1.1";
efi = { interfaces = {
canTouchEfiVariables = true; "${wanInterface}".useDHCP = true;
efiSysMountPoint = "/boot/"; "${lanInterface}" = {
}; useDHCP = false;
}; ipv4.addresses = [
extraModprobeConfig = "vboxdrv"; {
}; address = lanIpAddress;
users.users.greg.extraGroups = [ "vboxusers" ]; prefixLength = 16;
}
];
};
};
};
networking = { # Serves as the router, DHCP, and DNS for the site
hostName = "hosea"; greg = {
nameservers = [ "10.42.1.5" ]; tailscale.enable = true;
defaultGateway = "10.42.1.1"; home = true;
interfaces = { };
"${wanInterface}".useDHCP = true; services = {
"${lanInterface}" = { # Configure keymap
useDHCP = false; xserver.xkb = {
ipv4.addresses = [{ layout = "us";
address = lanIpAddress; variant = "";
prefixLength = 16; };
}]; };
};
};
};
# Serves as the router, DHCP, and DNS for the site
greg = {
tailscale.enable = true;
home = true;
};
services = {
# Configure keymap
xserver.xkb = {
layout = "us";
variant = "";
};
};
} }
+29 -14
View File
@@ -1,28 +1,43 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "uas" "sd_mod" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"uas"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/d4ac74f7-62bb-421a-aad8-566277c9d8ba"; device = "/dev/disk/by-uuid/d4ac74f7-62bb-421a-aad8-566277c9d8ba";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@" ]; options = [ "subvol=@" ];
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/1F51-B638"; device = "/dev/disk/by-uuid/1F51-B638";
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/chain" = {
device = "/dev/sda1";
fsType = "xfs";
};
swapDevices = [ ]; swapDevices = [ ];
-32
View File
@@ -1,32 +0,0 @@
{ config, pkgs, ... }:
let
minioPort = 9000;
minioConsolePort = 9001;
in {
fileSystems."/proxy" = {
device = "/dev/sda1";
fsType = "btrfs";
};
networking.firewall.allowedTCPPorts = [
80
minioPort
minioConsolePort
];
age.secrets.minio.file = ../../secrets/minio.age;
services.minio = {
enable = true;
dataDir = [ "/proxy/minio" ];
rootCredentialsFile = config.age.secrets.minio.path;
browser = true;
};
greg.proxies."s3.thehellings.lan".target = "http://127.0.0.1:${toString minioPort}";
environment.systemPackages = with pkgs; [
minio-client
];
}
+8 -8
View File
@@ -1,11 +1,11 @@
{ pkgs, config, ...}: { ... }:
{ {
# Bootloader. # Bootloader.
boot = { boot = {
loader.grub = { loader.grub = {
enable = true; enable = true;
device = "/dev/sda"; device = "/dev/sda";
}; };
}; };
} }
+20 -16
View File
@@ -2,23 +2,27 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, agenix, ... }: { pkgs, ... }:
{ {
imports = [ # Include the results of the hardware scan. imports = [
./hardware-configuration.nix # Include the results of the hardware scan.
./boot.nix ./hardware-configuration.nix
./filesystem.nix ./boot.nix
./location.nix ./filesystem.nix
./networking.nix ./location.nix
./wiki.nix ./networking.nix
]; ./wiki.nix
];
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.greg = { users.users.greg = {
isNormalUser = true; isNormalUser = true;
description = "Gregory Hellings"; description = "Gregory Hellings";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [
packages = with pkgs; []; "networkmanager"
}; "wheel"
];
packages = with pkgs; [ ];
};
} }
+9 -8
View File
@@ -1,12 +1,13 @@
{ ... }: { ... }:
let let
in { in
fileSystems."serve" = { {
#device = "10.42.1.4:/volume1/icdm-mysql/"; fileSystems."serve" = {
#fsType = "nfs"; #device = "10.42.1.4:/volume1/icdm-mysql/";
device = "/dev/sdb1"; #fsType = "nfs";
fsType = "auto"; device = "/dev/sdb1";
mountPoint = "/srv"; fsType = "auto";
}; mountPoint = "/srv";
};
} }
+29 -21
View File
@@ -1,37 +1,45 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"ehci_pci"
"ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/dab0d455-e25e-4445-8fa4-5320047d7e7b"; device = "/dev/disk/by-uuid/dab0d455-e25e-4445-8fa4-5320047d7e7b";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@" ]; options = [ "subvol=@" ];
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/5aedbb07-5761-423b-909d-2560405eae32"; device = "/dev/disk/by-uuid/5aedbb07-5761-423b-909d-2560405eae32";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/var" = fileSystems."/var" = {
{ device = "/dev/disk/by-uuid/57968536-c29d-417d-997e-85223d1d1f65"; device = "/dev/disk/by-uuid/57968536-c29d-417d-997e-85223d1d1f65";
fsType = "btrfs"; fsType = "btrfs";
}; };
swapDevices = swapDevices = [ { device = "/dev/disk/by-uuid/09691dce-375a-43c6-8d40-4498d20a6d9a"; } ];
[ { device = "/dev/disk/by-uuid/09691dce-375a-43c6-8d40-4498d20a6d9a"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's
+1 -1
View File
@@ -1,4 +1,4 @@
{...}: { ... }:
{ {
# Set your time zone. # Set your time zone.
+56 -51
View File
@@ -1,58 +1,63 @@
{...}: { ... }:
let let
dnsHosts = builtins.concatStringsSep "\n" [ dnsHosts = builtins.concatStringsSep "\n" [ "wiki.icdm.lan 10.42.101.1" ];
"wiki.icdm.lan 10.42.101.1"
];
in in
{ {
# If we have to do proxying in Bayonnais, we can start to work on that here # If we have to do proxying in Bayonnais, we can start to work on that here
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
networking = { networking = {
hostName = "icdm-root"; hostName = "icdm-root";
useDHCP = false; useDHCP = false;
defaultGateway = "10.42.1.1"; defaultGateway = "10.42.1.1";
nameservers = [ "100.100.100.100" "10.42.1.2" ]; nameservers = [
enableIPv6 = false; "100.100.100.100"
"10.42.1.2"
];
enableIPv6 = false;
interfaces = { interfaces = {
eno1.ipv4.addresses = [ { eno1.ipv4.addresses = [
address = "10.42.101.1"; {
prefixLength = 16; address = "10.42.101.1";
} { prefixLength = 16;
address = "10.77.1.2"; }
prefixLength = 16; {
} ]; address = "10.77.1.2";
}; prefixLength = 16;
# Allow traffic through }
firewall = { ];
enable = true; };
allowedTCPPorts = [ 53 ]; # Allow traffic through
allowedUDPPorts = [ 53 67 ]; firewall = {
}; enable = true;
allowedTCPPorts = [ 53 ];
allowedUDPPorts = [
53
67
];
};
extraHosts = "${dnsHosts}"; extraHosts = "${dnsHosts}";
}; };
services.dnsmasq = { services.dnsmasq = {
enable = true; enable = true;
settings = { settings = {
domain = "icdm.lan"; domain = "icdm.lan";
dhcp-range = [ dhcp-range = [ "eno1,10.77.1.10,10.77.1.255,255.255.0.0,12h" ];
"eno1,10.77.1.10,10.77.1.255,255.255.0.0,12h" dhcp-option = [
]; "eno1,option:router,10.77.1.1"
dhcp-option = [ "eno1,option:dns-server,10.77.1.2,1.1.1.1"
"eno1,option:router,10.77.1.1" "eno1,option:domain-search,icdm.lan"
"eno1,option:dns-server,10.77.1.2,1.1.1.1" ];
"eno1,option:domain-search,icdm.lan" expand-hosts = true;
]; log-dhcp = true;
expand-hosts = true; log-queries = true;
log-dhcp = true; # Upstream servers
log-queries = true; server = [
# Upstream servers "1.1.1.1"
server = [ "8.8.4.4"
"1.1.1.1" ];
"8.8.4.4" };
]; };
};
};
} }
+10 -27
View File
@@ -1,32 +1,15 @@
{ pkgs, ... }: { ... }:
let let
wikiPasswordFile = "/var/mediawiki/passwordFile"; wikiHost = "wiki.icdm.lan";
wikiHost = "wiki.icdm.lan"; kiwixport = 8080;
kiwixport = 8080;
dependents = with pkgs; [
enwiki-dump
transmission
];
in in
{ {
services.kiwix-serve = { services.kiwix-serve = {
enable = true; enable = true;
port = kiwixport; port = kiwixport;
path = "/srv/zims/*.zim"; path = "/srv/zims/*.zim";
}; };
services.transmission = { greg.proxies."${wikiHost}".target = "http://localhost:${toString kiwixport}";
enable = true; networking.firewall.allowedTCPPorts = [ 80 ];
settings = {
download-dir = "/srv";
incomplete-dir = "/srv/incomplete";
rpc-bind-address = "0.0.0.0";
rpc-whitelist = "10.42.*,127.*,localhost";
};
};
greg.proxies."${wikiHost}".target = "http://localhost:${toString kiwixport}";
networking.firewall.allowedTCPPorts = [ 80 ];
environment.systemPackages = dependents;
} }
+14 -11
View File
@@ -1,15 +1,18 @@
{ pkgs, lib, modulesPath, ... }: {
pkgs,
lib,
modulesPath,
...
}:
{ {
imports = [ imports = [
"${modulesPath}/installer/cd-dvd/installation-cd-graphical-calamares-gnome.nix" "${modulesPath}/installer/cd-dvd/installation-cd-graphical-calamares-gnome.nix"
"${modulesPath}/installer/cd-dvd/channel.nix" "${modulesPath}/installer/cd-dvd/channel.nix"
]; ];
networking.networkmanager.enable = lib.mkForce false; networking.networkmanager.enable = lib.mkForce false;
users.users.greg.initialPassword = ""; users.users.greg.initialPassword = "";
#services.getty.autologinUser = lib.mkForce "greg"; #services.getty.autologinUser = lib.mkForce "greg";
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [ tree ];
tree
];
} }
+30 -29
View File
@@ -1,33 +1,34 @@
{ config, ... }: { config, ... }:
let let
publicIp = (builtins.elemAt config.networking.interfaces.enp68s0.ipv4.addresses 0).address; publicIp = (builtins.elemAt config.networking.interfaces.enp68s0.ipv4.addresses 0).address;
sanIp = (builtins.elemAt config.networking.interfaces.enp67s0.ipv4.addresses 0).address; sanIp = (builtins.elemAt config.networking.interfaces.enp67s0.ipv4.addresses 0).address;
vip = (builtins.elemAt config.networking.interfaces.enp68s0.ipv4.addresses 1).address; vip = (builtins.elemAt config.networking.interfaces.enp68s0.ipv4.addresses 1).address;
hostname = config.networking.hostName; hostname = config.networking.hostName;
baseConfig = import ../../ceph/home.nix; baseConfig = import ../../ceph/home.nix;
in { in
services.ceph-benaco = baseConfig // { {
enable = false; services.ceph-benaco = baseConfig // {
monitor = { enable = false;
enable = false; monitor = {
initialKeyring = ../../secrets/home.mon.keyring; enable = false;
nodeName = hostname; initialKeyring = ../../secrets/home.mon.keyring;
bindAddr = publicIp; nodeName = hostname;
advertisedPublicAddr = vip; bindAddr = publicIp;
}; advertisedPublicAddr = vip;
osdBindAddr = publicIp; };
osdAdvertisedPublicAddr = publicIp; osdBindAddr = publicIp;
osds = { osdAdvertisedPublicAddr = publicIp;
osd1 = { osds = {
enable = false; osd1 = {
bootstrapKeyring = ../../secrets/home.osd-bootstrap.keyring; enable = false;
id = 1; bootstrapKeyring = ../../secrets/home.osd-bootstrap.keyring;
uuid = "c13bd2b1-cfc7-4966-8da5-d92356e87e06"; id = 1;
blockDevice = "/dev/sda"; uuid = "c13bd2b1-cfc7-4966-8da5-d92356e87e06";
blockDeviceUdevRuleMatcher = ''KERNEL=="sda"''; blockDevice = "/dev/sda";
clusterAddress = sanIp; blockDeviceUdevRuleMatcher = ''KERNEL=="sda"'';
}; clusterAddress = sanIp;
}; };
}; };
};
} }
+126 -119
View File
@@ -2,129 +2,136 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
imports = imports = [
[ # Include the results of the hardware scan. # Include the results of the hardware scan.
./ceph.nix ./ceph.nix
./hardware-configuration.nix ./hardware-configuration.nix
./minio.nix ./minio.nix
]; ];
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
networking = { networking = {
hostName = "jeremiah"; # Define your hostname. hostName = "jeremiah"; # Define your hostname.
useDHCP = false; useDHCP = false;
defaultGateway = { defaultGateway = {
address = " 10.42.1.1"; address = " 10.42.1.1";
interface = "enp68s0"; interface = "enp68s0";
}; };
vlans = { vlans = {
san = { san = {
id = 616; id = 616;
interface = "enp67s0"; interface = "enp67s0";
}; };
}; };
interfaces = { interfaces = {
enp68s0 = { enp68s0 = {
ipv4.addresses = [ { ipv4.addresses = [
address = "10.42.1.8"; {
prefixLength = 16; address = "10.42.1.8";
} { prefixLength = 16;
address = "10.42.100.1"; }
prefixLength = 16; {
} ]; address = "10.42.100.1";
}; prefixLength = 16;
san = { }
ipv4.addresses = [ { ];
address = "10.201.1.2"; };
prefixLength = 24; san = {
} ]; ipv4.addresses = [
}; {
}; address = "10.201.1.2";
nameservers = [ prefixLength = 24;
"10.42.1.5" }
]; ];
}; };
greg = { };
home = true; nameservers = [ "10.42.1.5" ];
tailscale.enable = true; };
}; greg = {
environment.systemPackages = with pkgs; [ home = true;
btrfs-progs tailscale.enable = true;
curl };
gawk environment.systemPackages = with pkgs; [
git curl
unzip gawk
wget git
]; unzip
wget
fileSystems = { ];
"/nix" = {
fsType = "btrfs";
options = [ "subvol=nix" ];
device = "/dev/nvme0n1p1";
};
"/var" = {
fsType = "btrfs";
options = [ "subvol=var" ];
device = "/dev/nvme0n1p1";
};
};
##################################################################################### fileSystems = {
#################### Virtualbox Runner ############################################## "/nix" = {
##################################################################################### fsType = "btrfs";
services = { options = [ "subvol=nix" ];
gitlab-runner = { device = "/dev/nvme0n1p1";
enable = true; };
settings.concurrent = 7; "/var" = {
services = { fsType = "btrfs";
shell = { options = [ "subvol=var" ];
executor = "shell"; device = "/dev/nvme0n1p1";
limit = 5; };
registrationConfigFile = config.age.secrets.runner-reg.path; };
environmentVariables = {
EFI_DIR = "${pkgs.OVMF.fd}/FV/";
STORAGE_URL = "http://s3.thehellings.lan:9000";
};
};
};
};
};
age.secrets.runner-reg.file = ../../secrets/gitlab/jeremiah-runner-reg.age;
virtualisation.virtualbox.host = {
enable = true;
enableExtensionPack = true;
enableHardening = false;
headless = true;
enableWebService = true;
};
systemd.services."gitlab-runner" = { #####################################################################################
after = [ #################### Virtualbox Runner ##############################################
"network.target" #####################################################################################
"network-online.target" services = {
"systemd-resolved.service" gitlab-runner = {
]; enable = true;
wants = [ settings.concurrent = 7;
"network-online.target" services = {
"systemd-resolved.service" shell = {
]; executor = "shell";
preStart = builtins.concatStringsSep "\n" [ limit = 5;
"${pkgs.kmod}/bin/modprobe vboxdrv" authenticationTokenConfigFile = config.age.secrets.runner-reg.path;
"${pkgs.kmod}/bin/modprobe vboxnetadp" environmentVariables = {
"${pkgs.kmod}/bin/modprobe vboxnetflt" EFI_DIR = "${pkgs.OVMF.fd}/FV/";
]; STORAGE_URL = "http://s3.thehellings.lan:9000";
postStop = "${pkgs.kmod}/bin/rmmod vboxnetadp vboxnetflt vboxdrv"; };
serviceConfig = { };
DevicePolicy = lib.mkForce "auto"; };
User = "root"; };
DynamicUser = lib.mkForce false; };
}; age.secrets.runner-reg.file = ../../secrets/gitlab/jeremiah-runner-reg.age;
}; virtualisation.virtualbox.host = {
enable = true;
enableExtensionPack = true;
enableHardening = false;
headless = true;
enableWebService = true;
};
systemd.services."gitlab-runner" = {
after = [
"network.target"
"network-online.target"
"systemd-resolved.service"
];
wants = [
"network-online.target"
"systemd-resolved.service"
];
preStart = builtins.concatStringsSep "\n" [
"${pkgs.kmod}/bin/modprobe vboxdrv"
"${pkgs.kmod}/bin/modprobe vboxnetadp"
"${pkgs.kmod}/bin/modprobe vboxnetflt"
];
postStop = "${pkgs.kmod}/bin/rmmod vboxnetadp vboxnetflt vboxdrv";
serviceConfig = {
DevicePolicy = lib.mkForce "auto";
User = "root";
DynamicUser = lib.mkForce false;
};
};
} }
+23 -13
View File
@@ -1,27 +1,37 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "uas" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"uas"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/ffc167f5-d9e4-4b11-a5f1-f7da0550ad24"; device = "/dev/disk/by-uuid/ffc167f5-d9e4-4b11-a5f1-f7da0550ad24";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/3047-870E"; device = "/dev/disk/by-uuid/3047-870E";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ ]; swapDevices = [ ];
+24 -23
View File
@@ -1,32 +1,33 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
minioPort = 9000; minioPort = 9000;
minioConsolePort = 9001; minioConsolePort = 9001;
in { in
environment.systemPackages = with pkgs; [ {
minio-client environment.systemPackages = with pkgs; [
xfsprogs minio-client
]; xfsprogs
];
greg.proxies."minio-02.thehellings.lan".target = "http://localhost:9000"; greg.proxies."minio-02.thehellings.lan".target = "http://localhost:9000";
fileSystems."/data/1" = { fileSystems."/data/1" = {
device = "/dev/disk/by-id/ata-ST12000NM0558_ZHZ5YSXW-part1"; device = "/dev/disk/by-id/ata-ST12000NM0558_ZHZ5YSXW-part1";
fsType = "xfs"; fsType = "xfs";
}; };
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
minioPort minioPort
minioConsolePort minioConsolePort
]; ];
age.secrets.minio.file = ../../secrets/minio.age; age.secrets.minio.file = ../../secrets/minio.age;
services.minio = { services.minio = {
enable = true; enable = true;
dataDir = [ "/data/1/minio" ]; dataDir = [ "/data/1/minio" ];
rootCredentialsFile = config.age.secrets.minio.path; rootCredentialsFile = config.age.secrets.minio.path;
browser = true; browser = true;
}; };
} }
+51 -46
View File
@@ -1,50 +1,55 @@
{ lib, pkgs, ... }: { lib, pkgs, ... }:
{ {
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot = { boot = {
binfmt.emulatedSystems = [ "aarch64-linux" ]; binfmt.emulatedSystems = [ "aarch64-linux" ];
kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.linuxPackages_latest;
supportedFilesystems = [ "ntfs" ]; supportedFilesystems = [ "ntfs" ];
loader = { loader = {
timeout = 15; timeout = 15;
systemd-boot = { systemd-boot = {
enable = true; enable = true;
configurationLimit = 20; configurationLimit = 20;
extraEntries = { extraEntries = {
"Windows.conf" = (lib.strings.concatStringsSep "\n" [ "Windows.conf" = (
"title Windows" lib.strings.concatStringsSep "\n" [
"efi /EFI/Microsoft/EFI/bootmgfw.efi" "title Windows"
]); "efi /EFI/Microsoft/EFI/bootmgfw.efi"
"Win2.conf" = (lib.strings.concatStringsSep "\n" [ ]
"title Windows 11" );
"efi /shellx64.efi" "Win2.conf" = (
"options -nointerrupt -noconsolein -noconsoleout windows11.nsh" lib.strings.concatStringsSep "\n" [
]); "title Windows 11"
"Shell.conf" = (lib.strings.concatStringsSep "\n" [ "efi /shellx64.efi"
"title EFI Shell" "options -nointerrupt -noconsolein -noconsoleout windows11.nsh"
"efi /shell.efi" ]
]); );
}; "Shell.conf" = (
extraFiles = { lib.strings.concatStringsSep "\n" [
"windows11.nsh" = (pkgs.writeText "windows11.nsh" (lib.strings.concatStringsSep "\n" [ "title EFI Shell"
])); "efi /shell.efi"
"shell.efi" = "${pkgs.edk2-uefi-shell}/shell.efi"; ]
}; );
}; };
grub = { extraFiles = {
enable = false; "windows11.nsh" = (pkgs.writeText "windows11.nsh" (lib.strings.concatStringsSep "\n" [ ]));
device = "/dev/nvme0n1"; "shell.efi" = "${pkgs.edk2-uefi-shell}/shell.efi";
useOSProber = true; };
efiSupport = true; };
extraEntries = '' grub = {
menuentry "Windows" --class windows --class os { enable = false;
insmod ntfs device = "/dev/nvme0n1";
chainloader (hd0,0)/EFI/Windows/bootmgfw.efi useOSProber = true;
} efiSupport = true;
''; extraEntries = ''
}; menuentry "Windows" --class windows --class os {
#efi.canTouchEfiVariables = true; insmod ntfs
}; chainloader (hd0,0)/EFI/Windows/bootmgfw.efi
}; }
'';
};
#efi.canTouchEfiVariables = true;
};
};
} }
+120 -110
View File
@@ -1,119 +1,129 @@
{ pkgs, config, ... }: { pkgs, config, ... }:
{ {
imports = [ imports = [
./boot.nix ./boot.nix
./hardware-configuration.nix ./hardware-configuration.nix
./podman.nix ./podman.nix
./printing.nix ./virt.nix
./virt.nix ./work.nix
]; ];
programs = { programs = {
steam.enable = true; steam.enable = true;
nix-index = { nix-index = {
enable = true; enable = true;
enableBashIntegration = false; enableBashIntegration = false;
enableFishIntegration = false; enableFishIntegration = false;
enableZshIntegration = false; enableZshIntegration = false;
}; };
nix-ld.enable = false; nix-ld.enable = false;
}; };
networking = { networking = {
hostName = "jude"; hostName = "jude";
enableIPv6 = false; enableIPv6 = false;
interfaces.enp12s0.useDHCP = true; interfaces.enp12s0.useDHCP = true;
firewall = { firewall = {
enable = false; enable = false;
allowedTCPPorts = [ 21000 ]; allowedTCPPorts = [ 21000 ];
allowedUDPPorts = [ 21000 21010 ]; allowedUDPPorts = [
}; 21000
}; 21010
greg = { ];
tailscale.enable = true; };
sway.enable = false; };
gnome.enable = true; greg = {
kde.enable = false; tailscale.enable = true;
}; sway.enable = false;
gnome.enable = false;
kde.enable = true;
print.enable = true;
remote-builder.enable = true;
};
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
environment.systemPackages = with pkgs; lib.mkMerge [ environment.systemPackages =
[ # for Immersed with pkgs;
cudatoolkit lib.mkMerge [
immersed-vr [
libva # for Immersed
] cudatoolkit
[ immersed
bind # For things like nslookup libva
create_ssl ]
distrobox [
expect bind # For things like nslookup
gimp create_ssl
go distrobox
gparted expect
gnucash gimp
graphviz go
flock gparted
ffmpeg gnucash
handbrake graphviz
imagemagick flock
libtheora ffmpeg
libxml2 handbrake
linode-cli imagemagick
makemkv libtheora
oathToolkit libxml2
usbutils linode-cli
vagrant makemkv
ventoy oathToolkit
] usbutils
ventoy
]
[ [
# Video/Audio data composition framework tools like "gst-inspect", "gst-launch" ... # Video/Audio data composition framework tools like "gst-inspect", "gst-launch" ...
gst_all_1.gstreamer gst_all_1.gstreamer
gst_all_1.gst-plugins-base gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-bad gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-ugly gst_all_1.gst-plugins-ugly
gst_all_1.gst-libav gst_all_1.gst-libav
gst_all_1.gst-vaapi gst_all_1.gst-vaapi
] ]
]; ];
fileSystems = { fileSystems = {
"/boot" = { "/boot" = {
device = "/dev/nvme0n1p1"; device = "/dev/nvme0n1p1";
fsType = "auto"; fsType = "auto";
}; };
"/windows" = { "/windows" = {
device = "/dev/nvme0n1p5"; device = "/dev/nvme0n1p5";
fsType = "ntfs-3g"; fsType = "ntfs-3g";
}; };
"/windows11" = { "/windows11" = {
device = "/dev/nvme1n1p2"; device = "/dev/nvme1n1p2";
fsType = "ntfs-3g"; fsType = "ntfs-3g";
}; };
}; };
# Let's do a sound thing # Let's do a sound thing
services = { services = {
pipewire = { pipewire = {
enable = true; enable = true;
alsa.enable = true; alsa.enable = true;
audio.enable = true; audio.enable = true;
jack.enable = true; jack.enable = true;
pulse.enable = true; pulse.enable = true;
wireplumber.enable = true; wireplumber.enable = true;
}; };
locate.enable = true; locate.enable = true;
xserver.videoDrivers = [ "nvidia" ]; xserver.videoDrivers = [ "nvidia" ];
}; };
hardware = { hardware = {
nvidia = { nvidia = {
modesetting.enable = true; modesetting.enable = true;
nvidiaSettings = true; nvidiaSettings = true;
#open = true; open = true;
}; };
pulseaudio.enable = false; # This conflicts with pipewire pulseaudio.enable = false; # This conflicts with pipewire
system76.enableAll = true; system76 = {
}; firmware-daemon.enable = true;
#kernel-modules.enable = true;
};
};
} }
+20 -10
View File
@@ -1,23 +1,33 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ #device = "/dev/disk/by-uuid/27ae91ed-32e9-411e-8227-0d99e360fbbf"; #device = "/dev/disk/by-uuid/27ae91ed-32e9-411e-8227-0d99e360fbbf";
device = "/dev/nvme0n1p4"; device = "/dev/nvme0n1p4";
fsType = "btrfs"; fsType = "btrfs";
}; };
swapDevices = [ ]; swapDevices = [ ];
+4 -4
View File
@@ -1,8 +1,8 @@
{ ... }: { ... }:
{ {
virtualisation.podman = { virtualisation.podman = {
enable = true; enable = true;
dockerCompat = true; dockerCompat = true;
}; };
} }
-12
View File
@@ -1,12 +0,0 @@
{ pkgs, ... }:
{
# ipp://printer.thehellings.lan:631/ - generic postscript printer
services.printing = {
enable = true;
drivers = with pkgs; [
gutenprint
gutenprintBin
];
};
}
+30 -30
View File
@@ -1,38 +1,38 @@
{ pkgs, config, ... }: { pkgs, config, ... }:
{ {
greg.vmdev.enable = true; greg.vmdev.enable = true;
virtualisation = { virtualisation = {
waydroid.enable = false; waydroid.enable = false;
lxd.enable = false; lxd.enable = false;
}; };
systemd.services = { systemd.services = {
gitlab-runner = { gitlab-runner = {
conflicts = [ "libvirtd.service" ]; conflicts = [ "libvirtd.service" ];
preStart = builtins.concatStringsSep "\n" [ preStart = builtins.concatStringsSep "\n" [
"${pkgs.kmod}/bin/modprobe vboxnetflt vboxdrv" "${pkgs.kmod}/bin/modprobe vboxnetflt vboxdrv"
"${pkgs.kmod}/bin/modprobe vboxnetadp" "${pkgs.kmod}/bin/modprobe vboxnetadp"
]; ];
postStop = "${pkgs.kmod}/bin/rmmod vboxnetflt vboxnetadp vboxdrv"; postStop = "${pkgs.kmod}/bin/rmmod vboxnetflt vboxnetadp vboxdrv";
wantedBy = pkgs.lib.mkForce []; wantedBy = pkgs.lib.mkForce [ ];
serviceConfig.User = "root"; serviceConfig.User = "root";
}; };
}; };
age.secrets.runner-reg.file = ../../secrets/gitlab/myself-vbox-runner-reg.age; age.secrets.runner-reg.file = ../../secrets/gitlab/myself-vbox-runner-reg.age;
services.gitlab-runner = { services.gitlab-runner = {
enable = true; enable = true;
settings.concurrent = 5; settings.concurrent = 5;
services.vbox = { services.vbox = {
executor = "shell"; executor = "shell";
limit = 5; limit = 5;
registrationConfigFile = config.age.secrets.runner-reg.path; authenticationTokenConfigFile = config.age.secrets.runner-reg.path;
environmentVariables = { environmentVariables = {
EFI_DIR = "${pkgs.OVMF.fd}/FV/"; EFI_DIR = "${pkgs.OVMF.fd}/FV/";
}; };
}; };
}; };
} }
+8
View File
@@ -0,0 +1,8 @@
{ pkgs, ... }:
{
services.mongodb = {
enable = false;
};
environment.systemPackages = with pkgs; [ mongodb-compass ];
}
+74 -66
View File
@@ -1,78 +1,86 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
{ {
imports = [ imports = [
./git.nix ./git.nix
./hardware-configuration.nix ./hardware-configuration.nix
./podman.nix ./podman.nix
./matrix.nix ./matrix.nix
./nextcloud.nix ./nextcloud.nix
./nginx.nix ./nginx.nix
./postgres.nix ./postgres.nix
]; ];
greg = { greg = {
home = false; home = false;
linode.enable = true; linode.enable = true;
tailscale.enable = true; tailscale.enable = true;
}; };
programs.ssh.extraConfig = lib.strings.concatStringsSep "\n" [ programs.ssh.extraConfig = lib.strings.concatStringsSep "\n" [
"Host chronicles.shire-zebra.ts.net" "Host chronicles.shire-zebra.ts.net"
" User backup" " User backup"
" IdentityFile /etc/ssh/backup_ed25519" " IdentityFile /etc/ssh/backup_ed25519"
" StrictHostKeyChecking no" " StrictHostKeyChecking no"
" UserKnownHostsFile /dev/null" " UserKnownHostsFile /dev/null"
]; ];
networking = { networking = {
networkmanager.enable = lib.mkForce false; networkmanager.enable = lib.mkForce false;
hostName = "linode"; hostName = "linode";
domain = "thehellings.com"; domain = "thehellings.com";
nameservers = [ nameservers = [ "100.88.91.27" ];
"100.88.91.27" };
];
};
age.secrets.runner-deployer = { age.secrets.runner-deployer = {
file = ../../secrets/gitlab/linode-deployer-runner-reg.age; file = ../../secrets/gitlab/linode-deployer-runner-reg.age;
owner = "gitlab-runner"; owner = "gitlab-runner";
}; };
services.gitlab-runner = { services.gitlab-runner = {
enable = true; enable = true;
services.deployer = { services.deployer = {
executor = "shell"; executor = "shell";
registrationConfigFile = config.age.secrets.runner-deployer.path; authenticationTokenConfigFile = config.age.secrets.runner-deployer.path;
}; };
}; };
users.users.gitlab-runner = { users.users.gitlab-runner = {
isSystemUser = true; isSystemUser = true;
group = "gitlab-runner"; group = "gitlab-runner";
}; };
users.groups.gitlab-runner = {}; users.groups.gitlab-runner = { };
systemd.services."gitlab-runner".serviceConfig = { systemd.services."gitlab-runner".serviceConfig = {
DynamicUser = lib.mkForce false; DynamicUser = lib.mkForce false;
User = "gitlab-runner"; User = "gitlab-runner";
}; };
security.sudo.extraRules = [{ security.sudo.extraRules = [
users = [ "gitlab-runner" ]; {
commands = [{ users = [ "gitlab-runner" ];
command = "/run/current-system/sw/bin/systemctl"; commands = [
options = [ "NOPASSWD" ]; {
} { command = "/run/current-system/sw/bin/systemctl";
command = "/run/current-system/sw/bin/podman"; options = [ "NOPASSWD" ];
options = [ "NOPASSWD" ]; }
}]; {
}]; command = "/run/current-system/sw/bin/podman";
options = [ "NOPASSWD" ];
}
];
}
];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
bind bind
graphviz graphviz
nix-du nix-du
pgloader pgloader
]; ];
} }
+39 -38
View File
@@ -1,44 +1,45 @@
{ config, pkgs, ... }: { ... }:
let let
srcDomain = "src.thehellings.com"; srcDomain = "src.thehellings.com";
sshPort = 2222; sshPort = 2222;
in { in
greg.proxies."${srcDomain}" = { {
target = "http://git.thehellings.lan"; greg.proxies."${srcDomain}" = {
ssl = true; target = "http://git.thehellings.lan";
genAliases = false; ssl = true;
extraConfig = '' genAliases = false;
proxy_set_header X-Forwarded-Proto https; extraConfig = ''
proxy_set_header X-Forwarded-Ssl on; proxy_set_header X-Forwarded-Proto https;
''; proxy_set_header X-Forwarded-Ssl on;
}; '';
greg.proxies."registry.thehellings.com" = { };
target = "https://registry.thehellings.lan:5000"; greg.proxies."registry.thehellings.com" = {
ssl = true; target = "https://registry.thehellings.lan:5000";
genAliases = false; ssl = true;
extraConfig = "client_max_body_size 250m;"; genAliases = false;
}; extraConfig = "client_max_body_size 250m;";
};
networking.firewall.allowedTCPPorts = [ sshPort ]; networking.firewall.allowedTCPPorts = [ sshPort ];
services.haproxy = { services.haproxy = {
enable = true; enable = true;
config = builtins.concatStringsSep "\n" [ config = builtins.concatStringsSep "\n" [
"global" "global"
" daemon" " daemon"
" maxconn 20" " maxconn 20"
"defaults"
" timeout connect 500s"
" timeout client 500s"
" timeout server 1h"
"listen gitsshd" "defaults"
" bind *:${toString sshPort}" " timeout connect 500s"
" timeout client 1h" " timeout client 500s"
" mode tcp" " timeout server 1h"
" server git-thehellings-lan git.thehellings.lan:22"
]; "listen gitsshd"
}; " bind *:${toString sshPort}"
" timeout client 1h"
" mode tcp"
" server git-thehellings-lan git.thehellings.lan:22"
];
};
} }
+14 -8
View File
@@ -1,14 +1,22 @@
# Do not modify this file! It was generated by "nixos-generate-config" # Do not modify this file! It was generated by "nixos-generate-config"
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = [ imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_scsi" "ahci" "sd_mod" ]; boot.initrd.availableKernelModules = [
"virtio_pci"
"virtio_scsi"
"ahci"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
@@ -18,9 +26,7 @@
fsType = "ext4"; fsType = "ext4";
}; };
swapDevices = [ swapDevices = [ { device = "/dev/sdb"; } ];
#{ device = "/dev/sdb"; }
];
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }
+58 -48
View File
@@ -2,61 +2,71 @@
# them by the following commands: # them by the following commands:
# nix run nixpkgs.matrix-synapse # nix run nixpkgs.matrix-synapse
# register_new_matrix_user -k "B9EoPr2WV9hzwc7uL2Sx1JmvCeKDEOGCpB0uginQcQtEH4wzRtkSIdo7lltrjSQa" http://localhost:8448 # register_new_matrix_user -k "B9EoPr2WV9hzwc7uL2Sx1JmvCeKDEOGCpB0uginQcQtEH4wzRtkSIdo7lltrjSQa" http://localhost:8448
{ config, pkgs, ... }: { config, ... }:
let let
domain = "${config.networking.domain}"; domain = "${config.networking.domain}";
fqdn = "matrix.${domain}"; fqdn = "matrix.${domain}";
conn = "postgresql:///dendrite?sslmode=disable&host=/run/postgresql";
in in
{ {
services.nginx = { services.nginx = {
virtualHosts = { virtualHosts = {
# Server the '.well-known' files to find the Matrix API server # Server the '.well-known' files to find the Matrix API server
"${domain}" = { "${domain}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
# This is needed so that servers contacting hellings.com can find # This is needed so that servers contacting hellings.com can find
# the actual application server at matrix.thehellings.com # the actual application server at matrix.thehellings.com
locations."= /.well-known/matrix/server".extraConfig = locations."= /.well-known/matrix/server".extraConfig =
let let
server = { "m.server" = "${fqdn}:443"; }; server = {
in '' "m.server" = "${fqdn}:443";
add_header Content-Type application/json; };
return 200 '${builtins.toJSON server}'; in
''; ''
add_header Content-Type application/json;
return 200 '${builtins.toJSON server}';
'';
locations."= /.well-known/matrix/client".extraConfig = locations."= /.well-known/matrix/client".extraConfig =
let let
client = { client = {
"m.homeserver" = { "base_url" = "https://${fqdn}"; }; "m.homeserver" = {
"m.identity_server" = { "base_url" = "https://vector.im"; }; "base_url" = "https://${fqdn}";
}; };
in '' "m.identity_server" = {
add_header Content-Type application/json; "base_url" = "https://vector.im";
add_header Access-Control-Allow-Origin *; };
return 200 '${builtins.toJSON client}'; };
''; in
}; ''
add_header Content-Type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '${builtins.toJSON client}';
'';
};
# Reverse proxy in front of the actual Matrix server # Reverse proxy in front of the actual Matrix server
"${fqdn}" = { "${fqdn}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
# Not the appropriate place for the chat client # Not the appropriate place for the chat client
locations."/".extraConfig = "return 404;"; locations."/".extraConfig = "return 404;";
locations."/_matrix" = { locations."/_matrix" = {
proxyPass = "http://matrix.shire-zebra.ts.net:8448"; # Lacking the trailing / is correct proxyPass = "http://matrix.shire-zebra.ts.net:8448"; # Lacking the trailing / is correct
}; };
}; };
}; };
}; };
# Open networking ports for the server # Open networking ports for the server
networking.firewall = { networking.firewall = {
enable = true; enable = true;
allowedTCPPorts = [ 80 443 ]; allowedTCPPorts = [
}; 80
443
];
};
} }
+30 -30
View File
@@ -1,38 +1,38 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
age.secrets.nextcloudadmin.file = ../../secrets/nextcloudadmin.age; age.secrets.nextcloudadmin.file = ../../secrets/nextcloudadmin.age;
age.secrets.nextcloudadmin.owner = "nextcloud"; age.secrets.nextcloudadmin.owner = "nextcloud";
services.nextcloud = { services.nextcloud = {
enable = true; enable = true;
package = pkgs.nextcloud29; package = pkgs.nextcloud29;
appstoreEnable = true; appstoreEnable = true;
hostName = "next.${config.networking.domain}"; hostName = "next.${config.networking.domain}";
https = true; https = true;
config = { config = {
adminpassFile = config.age.secrets.nextcloudadmin.path; adminpassFile = config.age.secrets.nextcloudadmin.path;
adminuser = "greg"; adminuser = "greg";
dbhost = "/run/postgresql"; dbhost = "/run/postgresql";
dbtype = "pgsql"; dbtype = "pgsql";
}; };
settings = { settings = {
default_phone_region = "US"; default_phone_region = "US";
overwriteprotocol = "https"; overwriteprotocol = "https";
}; };
}; };
services.nginx.virtualHosts."next.thehellings.com" = { services.nginx.virtualHosts."next.thehellings.com" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
}; };
# Otherwise nginx errors looking for the nextcloud sock file # Otherwise nginx errors looking for the nextcloud sock file
systemd.services.nginx.after = [ "nextcloud.service" ]; systemd.services.nginx.after = [ "nextcloud.service" ];
greg.backup.jobs.nextcloud-bkup = { greg.backup.jobs.nextcloud-bkup = {
src = "/var/lib/nextcloud"; src = "/var/lib/nextcloud";
dest = "nextcloud-backup"; dest = "nextcloud-backup";
id = "rbfco-rvmis"; id = "rbfco-rvmis";
}; };
} }
+28 -28
View File
@@ -1,36 +1,36 @@
{ ... }: { ... }:
let let
homepage = "127.0.0.1:30080"; homepage = "127.0.0.1:30080";
in in
{ {
security.acme = { security.acme = {
acceptTerms = true; acceptTerms = true;
defaults.email = "greg.hellings@gmail.com"; defaults.email = "greg.hellings@gmail.com";
}; };
services.nginx = { services.nginx = {
enable = true; enable = true;
# If there are recommended settings, let's use them! # If there are recommended settings, let's use them!
recommendedGzipSettings = true; recommendedGzipSettings = true;
recommendedOptimisation = true; recommendedOptimisation = true;
recommendedProxySettings = true; recommendedProxySettings = true;
recommendedTlsSettings = true; recommendedTlsSettings = true;
}; };
# Actually serve the content from here # Actually serve the content from here
virtualisation.podman.enable = true; virtualisation.podman.enable = true;
virtualisation.oci-containers = { virtualisation.oci-containers = {
backend = "podman"; backend = "podman";
containers."homepage" = { containers."homepage" = {
# needs explicit port to match what gitlab-runner sees when pulling # needs explicit port to match what gitlab-runner sees when pulling
image = "registry.thehellings.com:443/greg/homepage/gregs-homepage:latest"; image = "registry.thehellings.com:443/greg/homepage/gregs-homepage:latest";
ports = [ "${homepage}:80" ]; ports = [ "${homepage}:80" ];
}; };
}; };
greg.proxies."thehellings.com" = { greg.proxies."thehellings.com" = {
target = "http://${homepage}/"; target = "http://${homepage}/";
ssl = true; ssl = true;
genAliases = false; genAliases = false;
}; };
} }
+5 -5
View File
@@ -1,9 +1,9 @@
{ ... }: { ... }:
{ {
virtualisation.podman = { virtualisation.podman = {
enable = true; enable = true;
dockerCompat = true; dockerCompat = true;
dockerSocket.enable = true; dockerSocket.enable = true;
}; };
} }
+52 -56
View File
@@ -1,63 +1,59 @@
{ config, pkgs, lib, ... }: { config, pkgs, ... }:
{ {
environment.systemPackages = [ environment.systemPackages = [ pkgs.upgrade-pg-cluster ];
pkgs.upgrade-pg-cluster
];
services.postgresql = { services.postgresql = {
enable = true; enable = true;
package = pkgs.postgresql_15; package = pkgs.postgresql_15;
checkConfig = true; checkConfig = true;
ensureDatabases = [ ensureDatabases = [ "nextcloud" ];
"nextcloud" #initialScript = pkgs.writeText "create-matrix-db.sql" ''
]; # CREATE ROLE "matrix-synapse" WITH LOGIN;
#initialScript = pkgs.writeText "create-matrix-db.sql" '' # CREATE DATABASE "synapse" WITH OWNER "matrix-synapse" TEMPLATE template0 LC_COLLATE = "C" LC_CTYPE = "C";
# CREATE ROLE "matrix-synapse" WITH LOGIN; # GRANT ALL PRIVILEGES ON DATABASE "synapse" TO "matrix-synapse";
# CREATE DATABASE "synapse" WITH OWNER "matrix-synapse" TEMPLATE template0 LC_COLLATE = "C" LC_CTYPE = "C"; #''; # These are done manually in order to set the LC_COLLATE values properly
# GRANT ALL PRIVILEGES ON DATABASE "synapse" TO "matrix-synapse"; ensureUsers = [
#''; # These are done manually in order to set the LC_COLLATE values properly {
ensureUsers = [ { name = "nextcloud";
name = "nextcloud"; ensureDBOwnership = true;
ensureDBOwnership = true; }
} ]; ];
settings = { settings = {
log_connections = true; log_connections = true;
log_statement = "all"; log_statement = "all";
logging_collector = true; logging_collector = true;
log_filename = "postgresql.log"; log_filename = "postgresql.log";
}; };
identMap = '' identMap = ''
root root postgres root root postgres
''; '';
}; };
services.postgresqlBackup = { services.postgresqlBackup = {
enable = true; enable = true;
databases = [ databases = [ "nextcloud" ];
"nextcloud" };
];
};
services.logrotate = { services.logrotate = {
enable = true; enable = true;
settings = { settings = {
postgresBackup = { postgresBackup = {
enable = true; enable = true;
files = "${config.services.postgresqlBackup.location}/*.gz"; files = "${config.services.postgresqlBackup.location}/*.gz";
}; };
postgresLog = { postgresLog = {
enable = true; enable = true;
files = "/var/lib/postgresql/*/log/*.log"; files = "/var/lib/postgresql/*/log/*.log";
compress = true; compress = true;
compresscmd = "${pkgs.xz}/bin/xz"; compresscmd = "${pkgs.xz}/bin/xz";
}; };
}; };
}; };
greg.backup.jobs.greg-postgresql-backup = { greg.backup.jobs.greg-postgresql-backup = {
src = config.services.postgresqlBackup.location; src = config.services.postgresqlBackup.location;
dest = "linode-postgres"; dest = "linode-postgres";
id = "9pwvg-s257a"; id = "9pwvg-s257a";
}; };
} }
+30 -29
View File
@@ -1,33 +1,34 @@
{ config, ... }: { config, ... }:
let let
publicIp = (builtins.elemAt config.networking.interfaces.enp38s0.ipv4.addresses 0).address; publicIp = (builtins.elemAt config.networking.interfaces.enp38s0.ipv4.addresses 0).address;
sanIp = (builtins.elemAt config.networking.interfaces.enp39s0.ipv4.addresses 0).address; sanIp = (builtins.elemAt config.networking.interfaces.enp39s0.ipv4.addresses 0).address;
vip = (builtins.elemAt config.networking.interfaces.enp38s0.ipv4.addresses 1).address; vip = (builtins.elemAt config.networking.interfaces.enp38s0.ipv4.addresses 1).address;
hostname = config.networking.hostName; hostname = config.networking.hostName;
baseConfig = import ../../ceph/home.nix; baseConfig = import ../../ceph/home.nix;
in { in
services.ceph-benaco = baseConfig // { {
enable = false; services.ceph-benaco = baseConfig // {
monitor = { enable = false;
enable = false; monitor = {
initialKeyring = ../../secrets/home.mon.keyring; enable = false;
nodeName = hostname; initialKeyring = ../../secrets/home.mon.keyring;
bindAddr = publicIp; nodeName = hostname;
advertisedPublicAddr = vip; bindAddr = publicIp;
}; advertisedPublicAddr = vip;
osdBindAddr = publicIp; };
osdAdvertisedPublicAddr = publicIp; osdBindAddr = publicIp;
osds = { osdAdvertisedPublicAddr = publicIp;
osd1 = { osds = {
enable = false; osd1 = {
bootstrapKeyring = ../../secrets/home.osd-bootstrap.keyring; enable = false;
id = 2; bootstrapKeyring = ../../secrets/home.osd-bootstrap.keyring;
uuid = "73424b68-210b-415f-800f-8767babea625"; id = 2;
blockDevice = "/dev/disk/by-id/ata-ST12000NM0558_ZHZ5WM4L"; uuid = "73424b68-210b-415f-800f-8767babea625";
blockDeviceUdevRuleMatcher = ''KERNEL=="sdb"''; blockDevice = "/dev/disk/by-id/ata-ST12000NM0558_ZHZ5WM4L";
clusterAddress = sanIp; blockDeviceUdevRuleMatcher = ''KERNEL=="sdb"'';
}; clusterAddress = sanIp;
}; };
}; };
};
} }
+215 -181
View File
@@ -1,195 +1,229 @@
{ config, pkgs, lib, ... }: let {
registryPort = 5000; config,
vpnIp = "100.78.226.76"; pkgs,
containerIp = "192.168.200.2"; lib,
in { ...
age.secretsMountPoint = "/run/derp"; }:
age.secrets = let let
cfg = n: { file = ../../secrets/gitlab/${n}.age; owner = "gitlab"; group = "gitlab"; mode = "0444"; }; registryPort = 5000;
in { vpnIp = "100.78.226.76";
gitlab-secret = cfg "secret"; containerIp = "192.168.200.2";
gitlab-otp = cfg "otp"; in
gitlab-db = cfg "db"; {
gitlab-jws = cfg "jws"; age.secretsMountPoint = "/run/derp";
gitlab-key = cfg "key"; age.secrets =
gitlab-cert = cfg "cert"; let
cfg = n: {
file = ../../secrets/gitlab/${n}.age;
owner = "gitlab";
group = "gitlab";
mode = "0444";
};
in
{
gitlab-secret = cfg "secret";
gitlab-otp = cfg "otp";
gitlab-db = cfg "db";
gitlab-jws = cfg "jws";
gitlab-key = cfg "key";
gitlab-cert = cfg "cert";
minio_access_key_id = { minio_access_key_id = {
file = ../../secrets/minio_access_key_id.age; file = ../../secrets/minio_access_key_id.age;
owner = "gitlab"; owner = "gitlab";
group = "gitlab"; group = "gitlab";
mode = "0444"; mode = "0444";
}; };
minio_secret_access_key = { minio_secret_access_key = {
file = ../../secrets/minio_secret_access_key.age; file = ../../secrets/minio_secret_access_key.age;
owner = "gitlab"; owner = "gitlab";
group = "gitlab"; group = "gitlab";
mode = "0444"; mode = "0444";
}; };
}; };
networking.firewall.allowedTCPPorts = [ 80 registryPort ]; networking.firewall.allowedTCPPorts = [
80
registryPort
];
greg.proxies = let greg.proxies =
t = { let
target = "http://unix:/run/gitlab/gitlab-workhorse.socket"; t = {
extraConfig = '' target = "http://unix:/run/gitlab/gitlab-workhorse.socket";
proxy_set_header X-Forwarded-Proto https; extraConfig = ''
proxy_set_header X-Forwarded-Ssl on; proxy_set_header X-Forwarded-Proto https;
''; proxy_set_header X-Forwarded-Ssl on;
}; '';
in { };
"${containerIp}" = t; in
"${vpnIp}" = t; {
"git.thehellings.lan" = t; "${containerIp}" = t;
}; "${vpnIp}" = t;
"git.thehellings.lan" = t;
};
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
programs.ssh.extraConfig = lib.strings.concatStringsSep "\n" [ programs.ssh.extraConfig = lib.strings.concatStringsSep "\n" [
"Host nas" "Host nas"
" User backup" " User backup"
" IdentityFile /etc/ssh/duplicity_ed25519" " IdentityFile /etc/ssh/duplicity_ed25519"
" StrictHostKeyChecking no" " StrictHostKeyChecking no"
" UserKnownHostsFile /dev/null" " UserKnownHostsFile /dev/null"
]; ];
greg.backup.jobs.nas-backup = { greg.backup.jobs.nas-backup = {
src = "/var/gitlab/state/backup/"; src = "/var/gitlab/state/backup/";
dest = "gitlab"; dest = "gitlab";
id = "yha^-s45h"; id = "yha^-s45h";
}; };
services = { services = {
gitlab = { gitlab = {
enable = true; enable = true;
backup = { backup = {
keepTime = 288; keepTime = 288;
startAt = [ "03:00" ]; startAt = [ "03:00" ];
}; };
host = "src.thehellings.com"; host = "src.thehellings.com";
https = true; https = true;
port = 443; port = 443;
extraConfig = { extraConfig = {
gitlab = { gitlab = {
trustedProxies = [ "100.109.86.8/32" ]; trustedProxies = [ "100.109.86.8/32" ];
}; };
}; };
initialRootEmail = "greg@thehellings.com"; initialRootEmail = "greg@thehellings.com";
initialRootPasswordFile = pkgs.writeText "initialRootPassword" "root_password"; initialRootPasswordFile = pkgs.writeText "initialRootPassword" "root_password";
pages = { pages = {
enable = true; enable = true;
settings.pages-domain = "pages.thehellings.com"; settings.pages-domain = "pages.thehellings.com";
}; };
puma = { puma = {
threadsMax = 6; threadsMax = 6;
threadsMin = 2; threadsMin = 2;
workers = 6; workers = 6;
}; };
redisUrl = "unix:${config.services.redis.servers.gitlab.unixSocket}"; redisUrl = "unix:${config.services.redis.servers.gitlab.unixSocket}";
registry = { registry = {
enable = true; enable = true;
certFile = config.age.secrets.gitlab-cert.path; certFile = config.age.secrets.gitlab-cert.path;
keyFile = config.age.secrets.gitlab-key.path; keyFile = config.age.secrets.gitlab-key.path;
externalAddress = "registry.thehellings.com"; externalAddress = "registry.thehellings.com";
externalPort = 443; externalPort = 443;
}; };
secrets = { secrets = {
secretFile = config.age.secrets.gitlab-secret.path; secretFile = config.age.secrets.gitlab-secret.path;
otpFile = config.age.secrets.gitlab-otp.path; otpFile = config.age.secrets.gitlab-otp.path;
dbFile = config.age.secrets.gitlab-db.path; dbFile = config.age.secrets.gitlab-db.path;
jwsFile = config.age.secrets.gitlab-jws.path; jwsFile = config.age.secrets.gitlab-jws.path;
}; };
extraConfig = { extraConfig = {
object_store = { object_store = {
enabled = true; enabled = true;
proxy_download = false; # Tell them to reach out to object storage themselves! proxy_download = false; # Tell them to reach out to object storage themselves!
connection = { connection = {
provider = "AWS"; provider = "AWS";
endpoint = "http://s3.thehellings.lan:9000"; endpoint = "http://s3.thehellings.lan:9000";
region = "us-east-1"; region = "us-east-1";
aws_access_key_id = { _secret = config.age.secrets.minio_access_key_id.path; }; aws_access_key_id = {
aws_secret_access_key = { _secret = config.age.secrets.minio_secret_access_key.path; }; _secret = config.age.secrets.minio_access_key_id.path;
path_style = true; # True for MinIO };
aws_signature_version = 2; aws_secret_access_key = {
}; _secret = config.age.secrets.minio_secret_access_key.path;
#storage_options = ...; };
objects = builtins.listToAttrs ( builtins.map (x: lib.attrsets.nameValuePair x { bucket = "gitlab-${builtins.replaceStrings [ "_" ] [ "-" ] x}"; }) [ path_style = true; # True for MinIO
"artifacts" aws_signature_version = 2;
"ci_secure_files" };
"dependency_proxy" #storage_options = ...;
"external_diffs" objects = builtins.listToAttrs (
"lfs" builtins.map
"packages" (
"pages" x: lib.attrsets.nameValuePair x { bucket = "gitlab-${builtins.replaceStrings [ "_" ] [ "-" ] x}"; }
"terraform_state" )
"uploads" [
]); "artifacts"
}; "ci_secure_files"
}; "dependency_proxy"
}; "external_diffs"
"lfs"
"packages"
"pages"
"terraform_state"
"uploads"
]
);
};
};
};
nginx.virtualHosts."gitlab.shire-zebra.ts.net" = { nginx.virtualHosts."gitlab.shire-zebra.ts.net" = {
listen = [ { listen = [
addr = vpnIp; {
port = registryPort; addr = vpnIp;
ssl = true; port = registryPort;
} ]; ssl = true;
locations."/" = { }
proxyPass = "http://127.0.0.1:5000/"; ];
recommendedProxySettings = true; locations."/" = {
}; proxyPass = "http://127.0.0.1:5000/";
extraConfig = builtins.concatStringsSep "\n" [ recommendedProxySettings = true;
"ssl_certificate /etc/certs/gitlab.shire-zebra.ts.net.crt ;" };
"ssl_certificate_key /etc/certs/gitlab.shire-zebra.ts.net.key ;" extraConfig = builtins.concatStringsSep "\n" [
"client_max_body_size 250m;" "ssl_certificate /etc/certs/gitlab.shire-zebra.ts.net.crt ;"
]; "ssl_certificate_key /etc/certs/gitlab.shire-zebra.ts.net.key ;"
}; "client_max_body_size 250m;"
];
};
# Fetch the SSL certificates for nginx to use # Fetch the SSL certificates for nginx to use
cron = { cron = {
enable = true; enable = true;
systemCronJobs = [ "0 0 1 */2 * cd /etc/certs && tailscale cert gitlab.shire-zebra.ts.net && chown nginx * && systemctl reload nginx" ]; systemCronJobs = [
}; "0 0 1 */2 * cd /etc/certs && tailscale cert gitlab.shire-zebra.ts.net && chown nginx * && systemctl reload nginx"
];
};
postgresql = { postgresql = {
enable = true; enable = true;
checkConfig = true; checkConfig = true;
ensureDatabases = [ "gitlab" ]; ensureDatabases = [ "gitlab" ];
ensureUsers = [ { ensureUsers = [
name = "gitlab"; {
ensureDBOwnership = true; name = "gitlab";
} ]; ensureDBOwnership = true;
settings = { }
log_connections = true; ];
log_statement = "all"; settings = {
logging_collector = true; log_connections = true;
log_filename = "postgresql.log"; log_statement = "all";
}; logging_collector = true;
}; log_filename = "postgresql.log";
};
};
redis.servers.gitlab = { redis.servers.gitlab = {
enable = true; enable = true;
}; };
resolved.enable = true; resolved.enable = true;
openssh.enable = true; openssh.enable = true;
}; };
# Do not start nginx until we have tailscaled up and running, so it can bind # Do not start nginx until we have tailscaled up and running, so it can bind
# to the 100.* addresses # to the 100.* addresses
systemd.services = { systemd.services = {
nginx = rec { nginx = rec {
after = [ after = [ "network-online.target" ];
"network-online.target" requires = [ "network-online.target" ];
]; wants = after;
wants = after; serviceConfig = {
serviceConfig = { RestartMaxDelaySec = "30s";
RestartMaxDelaySec = "30s"; RestartSteps = "5";
RestartSteps = "5"; };
}; };
}; tailscaled.partOf = [ "network-online.target" ];
tailscaled.partOf = [ "network-online.target" ]; };
}; system.stateVersion = lib.mkForce "24.05";
system.stateVersion = lib.mkForce "24.05";
} }
+95 -77
View File
@@ -1,91 +1,109 @@
{ inputs, name, extra ? {}, packages ? [], overlays }: {
top,
name,
extra ? { },
packages ? [ ],
overlays,
}:
({ config, pkgs, lib, ... }:
( (
lib.attrsets.recursiveUpdate { {
config,
pkgs,
lib,
...
}:
(lib.attrsets.recursiveUpdate
{
imports = [ imports = [
inputs.agenix.nixosModules.default top.agenix.nixosModules.default
inputs.self.modules.nixosModule top.self.modules.nixosModule
]; ];
nixpkgs.overlays = overlays; nixpkgs.overlays = overlays;
greg.tailscale.enable = true; greg.tailscale.enable = true;
age = { age = {
identityPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; identityPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
secrets.runner-reg = { secrets.runner-reg = {
file = ../../secrets/gitlab/myself-${name}-runner-reg.age; file = ../../secrets/gitlab/myself-${name}-runner-reg.age;
owner = "gitlab-runner"; owner = "gitlab-runner";
}; };
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages =
curl with pkgs;
gawk [
git curl
unzip gawk
xorriso git
wget unzip
] ++ packages; xorriso
wget
]
++ packages;
networking = { networking = {
useHostResolvConf = pkgs.lib.mkForce false; useHostResolvConf = pkgs.lib.mkForce false;
nameservers = [ "100.100.100.100" ]; nameservers = [ "100.100.100.100" ];
}; };
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
users.users.gitlab-runner = { users.users.gitlab-runner = {
isSystemUser = true; isSystemUser = true;
group = "kvm"; group = "kvm";
extraGroups = [ "kvm" ]; extraGroups = [ "kvm" ];
}; };
services = { services = {
gitlab-runner = { gitlab-runner = {
enable = true; enable = true;
settings.concurrent = 5; settings.concurrent = 5;
services = { services = {
shell = { shell = {
executor = "shell"; executor = "shell";
limit = 5; limit = 5;
registrationConfigFile = config.age.secrets.runner-reg.path; authenticationTokenConfigFile = config.age.secrets.runner-reg.path;
environmentVariables = { environmentVariables = {
EFI_DIR = "${pkgs.OVMF.fd}/FV/"; EFI_DIR = "${pkgs.OVMF.fd}/FV/";
STORAGE_URL = "http://s3.thehellings.lan:9000"; STORAGE_URL = "http://s3.thehellings.lan:9000";
}; };
}; };
}; };
}; };
resolved.enable = true; resolved.enable = true;
}; };
systemd.services.gitlab-runner = { systemd.services.gitlab-runner = {
wants = [ wants = [
"network-online.target" "network-online.target"
"systemd-resolved.service" "systemd-resolved.service"
]; ];
after = [ after = [
"network.target" "network.target"
"network-online.target" "network-online.target"
"systemd-resolved.service" "systemd-resolved.service"
]; ];
serviceConfig = { serviceConfig = {
DevicePolicy = lib.mkForce "auto"; DevicePolicy = lib.mkForce "auto";
PrivateDevices = false; PrivateDevices = false;
ProtectKernelModules = false; ProtectKernelModules = false;
DevicesAllow = [ "/dev/kvm" "/dev/mem" ]; DevicesAllow = [
DynamicUser = lib.mkForce false; "/dev/kvm"
User = "root"; "/dev/mem"
Group = "kvm"; ];
}; DynamicUser = lib.mkForce false;
}; User = "root";
Group = "kvm";
};
};
system.stateVersion = lib.mkForce "24.05"; system.stateVersion = lib.mkForce "24.05";
} }
extra extra
) # End of attrsets.recursiveUpdate ) # End of attrsets.recursiveUpdate
) # End of outter function wrapper ) # End of outter function wrapper
+84 -82
View File
@@ -1,86 +1,88 @@
{ config, pkgs, lib, ... }: { lib, ... }:
{ {
imports = [ imports = [
./ceph.nix ./ceph.nix
./hardware-configuration.nix ./hardware-configuration.nix
./git.nix ./git.nix
./matrix.nix ./matrix.nix
./minio.nix ./minio.nix
]; ];
greg.tailscale.enable = true; greg = {
tailscale.enable = true;
remote-builder.enable = true;
};
services = { services = {
openssh.enable = true; openssh.enable = true;
}; };
networking = { networking = {
hostName = "myself"; hostName = "myself";
useDHCP = false; useDHCP = false;
defaultGateway = { defaultGateway = {
address = " 10.42.1.1"; address = " 10.42.1.1";
interface = "enp38s0"; interface = "enp38s0";
}; };
vlans = { vlans = {
san = { san = {
id = 616; id = 616;
interface = "enp39s0"; interface = "enp39s0";
}; };
}; };
interfaces = { interfaces = {
enp38s0 = { enp38s0 = {
ipv4.addresses = [ { ipv4.addresses = [
address = "10.42.1.6"; {
prefixLength = 16; address = "10.42.1.6";
} { prefixLength = 16;
address = "10.42.100.1"; }
prefixLength = 16; {
} ]; address = "10.42.100.1";
}; prefixLength = 16;
san = { }
ipv4.addresses = [ { ];
address = "10.201.1.1"; };
prefixLength = 24; san = {
} ]; ipv4.addresses = [
}; {
}; address = "10.201.1.1";
nameservers = [ prefixLength = 24;
"10.42.1.5" }
]; ];
}; };
users = { };
users = { nameservers = [ "10.42.1.5" ];
greg = { };
extraGroups = [ users = {
"kvm" users = {
"sudo" greg = {
"wheel" extraGroups = [
]; "kvm"
isNormalUser = true; "sudo"
}; "wheel"
}; ];
}; isNormalUser = true;
system.stateVersion = lib.mkForce "24.05"; };
boot = { };
extraModprobeConfig = "options kvm_amd nested=1"; };
supportedFilesystems = [ "ntfs" ]; system.stateVersion = lib.mkForce "24.05";
loader = { boot = {
efi = { extraModprobeConfig = "options kvm_amd nested=1";
canTouchEfiVariables = true; supportedFilesystems = [ "ntfs" ];
efiSysMountPoint = "/boot"; loader = {
}; efi = {
systemd-boot = { canTouchEfiVariables = true;
enable = true; efiSysMountPoint = "/boot";
configurationLimit = 10; };
}; systemd-boot = {
}; enable = true;
binfmt.emulatedSystems = [ configurationLimit = 10;
"aarch64-linux" };
]; };
}; binfmt.emulatedSystems = [ "aarch64-linux" ];
nixpkgs.config = { };
allowUnfree = true; nixpkgs.config = {
permittedInsecurePackages = [ allowUnfree = true;
"nodejs-16.20.2" permittedInsecurePackages = [ "nodejs-16.20.2" ];
]; };
};
} }
+99 -133
View File
@@ -1,140 +1,106 @@
{ config, pkgs, lib, inputs, overlays, ... }: {
config,
pkgs,
lib,
...
}:
let let
gitlabStateDir = "/var/lib/gitlab";
in
{
networking = {
firewall = {
enable = true;
allowedTCPPorts = [ 80 ];
};
nat = {
enable = true;
internalInterfaces = [ "ve-+" ];
externalInterface = "enp38s0";
};
};
gitlabStateDir = "/var/lib/gitlab"; greg.proxies."git.thehellings.lan" = {
target = "http://192.168.200.2";
extraConfig = ''
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Ssl on;
'';
};
container = input: (lib.attrsets.recursiveUpdate { system.activationScripts.makeGitlabDir = lib.stringAfter [
bindMounts."/etc/ssh".hostPath = "/etc/ssh"; # For agenix secrets "var"
enableTun = true; ] "mkdir -p ${gitlabStateDir} && touch ${gitlabStateDir}/touch";
privateNetwork = true;
} input);
in {
networking = {
firewall = {
enable = true;
allowedTCPPorts = [ 80 ];
};
nat = {
enable = true;
internalInterfaces = [ "ve-+" ];
externalInterface = "enp38s0";
};
};
greg.proxies."git.thehellings.lan" = { greg.containers.gitlab = {
target = "http://192.168.200.2"; tailscale = true;
extraConfig = '' subnet = "200";
proxy_set_header X-Forwarded-Proto https; builder = (import ./container-git.nix);
proxy_set_header X-Forwarded-Ssl on; };
'';
};
system.activationScripts.makeGitlabDir = lib.stringAfter [ "var" ] "mkdir -p ${gitlabStateDir} && touch ${gitlabStateDir}/touch";
greg.containers.gitlab = { #####################################################################################
tailscale = true; #################### Local Podman/Docker Runner #####################################
subnet = "200"; #####################################################################################
builder = (import ./container-git.nix); age.secrets.runner-reg.file = ../../secrets/gitlab/myself-podman-runner-reg.age;
}; age.secrets.docker-auth.file = ../../secrets/gitlab/docker-auth.age;
age.secrets.runner-qemu.file = ../../secrets/gitlab/myself-qemu-runner-reg.age;
systemd.services = { systemd.services.gitlab-runner = {
"gitlab-runner" = { after = [ "network-online.target" ];
after = [ "container@github.service" ]; requires = [ "network-online.target" ];
preStart = builtins.concatStringsSep "\n" [ };
"${pkgs.kmod}/bin/modprobe kvm" services.gitlab-runner = {
"${pkgs.kmod}/bin/modprobe kvm_amd" enable = true;
]; settings = {
postStop = builtins.concatStringsSep "\n" [ concurrent = 5;
"${pkgs.kmod}/bin/rmmod -f kvm_amd kvm" };
]; services = {
serviceConfig = { default = {
DevicePolicy = lib.mkForce "auto"; executor = "docker";
DevicesAllow = [ "/dev/kvm" "/dev/mem" ]; authenticationTokenConfigFile = config.age.secrets.runner-reg.path;
EnvironmentFile = config.age.secrets.docker-auth.path; dockerImage = "gitlab.shire-zebra.ts.net:5000/greg/ci-images/fedora:latest";
PermissionsStartOnly = "true"; dockerAllowedImages = [
PrivateDevices = false; "alpine:*"
ProtectKernelModules = false; "debian:*"
}; "docker:*"
}; "fedora:*"
}; "python:*"
"ubuntu:*"
##################################################################################### "registry.gitlab.com/gitlab-org/*"
#################### Container Podman Runner ######################################## "registry.thehellings.com/*/*/*:*"
##################################################################################### "gitlab.shire-zebra.ts.net:5000/*/*/*:*"
containers.gitlab-runner-shell = container { ];
autoStart = true; dockerAllowedServices = [
hostAddress = "192.168.203.1"; "docker:*"
localAddress = "192.168.203.2"; "registry.thehellings.com/*/*/*:*"
config = ((import ./container-runner.nix) { "gitlab.shire-zebra.ts.net:5000/*/*/*:*"
inherit inputs overlays; ];
name = "shell"; dockerPrivileged = true;
extra.virtualisation.podman.enable = true; dockerVolumes = [
}); "/certs/client"
}; "/cache"
];
##################################################################################### };
#################### Local Podman/Docker Runner ##################################### qemu = {
##################################################################################### executor = "shell";
age.secrets.runner-reg.file = ../../secrets/gitlab/myself-podman-runner-reg.age; limit = 5;
age.secrets.docker-auth.file = ../../secrets/gitlab/docker-auth.age; authenticationTokenConfigFile = config.age.secrets.runner-qemu.path;
age.secrets.runner-qemu.file = ../../secrets/gitlab/myself-qemu-runner-reg.age; environmentVariables = {
services.gitlab-runner = { EFI_DIR = "${pkgs.OVMF.fd}/FV/";
enable = true; STORAGE_URL = "http://s3.thehellings.lan:9000";
settings = { };
concurrent = 5; };
}; };
services = { };
default = { virtualisation = {
executor = "docker"; podman.enable = true;
registrationConfigFile = config.age.secrets.runner-reg.path; oci-containers.backend = "podman";
dockerImage = "gitlab.shire-zebra.ts.net:5000/greg/ci-images/fedora:latest"; };
dockerAllowedImages = [ environment.systemPackages = with pkgs; [
"alpine:*" curl
"debian:*" gawk
"docker:*" git
"fedora:*" unzip
"python:*" wget
"ubuntu:*" ];
"hashicorp/*:*"
"koalaman/shellcheck:*"
"registry.gitlab.com/gitlab-org/*"
"registry.thehellings.com/*/*/*:*"
"gitlab.shire-zebra.ts.net:5000/*/*/*:*"
];
dockerAllowedServices = [
"docker:*"
"registry.thehellings.com/*/*/*:*"
"gitlab.shire-zebra.ts.net:5000/*/*/*:*"
];
dockerPrivileged = true;
dockerVolumes = [
"/certs/client"
"/cache"
];
};
qemu = {
executor = "shell";
limit = 5;
registrationConfigFile = config.age.secrets.runner-qemu.path;
environmentVariables = {
EFI_DIR = "${pkgs.OVMF.fd}/FV/";
STORAGE_URL = "http://s3.thehellings.lan:9000";
};
};
};
};
virtualisation = {
docker.enable = true;
oci-containers.backend = "docker";
};
environment.systemPackages = with pkgs; [
curl
gawk
git
unzip
wget
];
} }
+48 -37
View File
@@ -1,51 +1,62 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
modulesPath,
...
}:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; boot.initrd.availableKernelModules = [
boot.initrd.kernelModules = [ ]; "nvme"
boot.kernelModules = [ "kvm-amd" ]; "xhci_pci"
boot.extraModulePackages = [ ]; "ahci"
"usb_storage"
"usbhid"
"sd_mod"
"sr_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/714744ca-dd9d-4713-b571-c6ccfbf56d79"; device = "/dev/disk/by-uuid/714744ca-dd9d-4713-b571-c6ccfbf56d79";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=nixos" ]; options = [ "subvol=nixos" ];
}; };
fileSystems."/home" = fileSystems."/home" = {
{ device = "/dev/disk/by-uuid/714744ca-dd9d-4713-b571-c6ccfbf56d79"; device = "/dev/disk/by-uuid/714744ca-dd9d-4713-b571-c6ccfbf56d79";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=home" ]; options = [ "subvol=home" ];
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/29E7-E20C"; device = "/dev/disk/by-uuid/29E7-E20C";
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/myvol" = fileSystems."/myvol" = {
{ device = "/dev/nvme0n1p1"; device = "/dev/nvme0n1p1";
fsType = "btrfs"; fsType = "btrfs";
}; };
swapDevices = [ ]; swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (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 # 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`. # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp38s0.useDHCP = lib.mkDefault true; # networking.interfaces.enp38s0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp39s0.useDHCP = lib.mkDefault true; # networking.interfaces.enp39s0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp42s0f3u5u3c2.useDHCP = lib.mkDefault true; # networking.interfaces.enp42s0f3u5u3c2.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }
+88 -79
View File
@@ -1,90 +1,99 @@
{ config, pkgs, inputs, lib, ... }: { pkgs, ... }:
let let
domain = "thehellings.com"; conn = "postgresql:///dendrite?sslmode=disable&host=/run/postgresql";
fqdn = "matrix.${domain}";
conn = "postgresql:///dendrite?sslmode=disable&host=/run/postgresql";
in in
{ {
environment.systemPackages = with pkgs; [ upgrade-pg-cluster ]; environment.systemPackages = with pkgs; [ upgrade-pg-cluster ];
greg.containers.matrix = { greg.containers.matrix = {
tailscale = true; tailscale = true;
subnet = "204"; subnet = "204";
builder = { pkgs, config, ... }: { builder =
networking.firewall.allowedTCPPorts = [ config.services.dendrite.httpPort ]; { config, ... }:
{
networking.firewall.allowedTCPPorts = [ config.services.dendrite.httpPort ];
# Environment secrets # Environment secrets
age = { age = {
secrets.dendrite = { secrets.dendrite = {
file = ../../secrets/dendrite.age; file = ../../secrets/dendrite.age;
owner = "dendrite"; owner = "dendrite";
}; };
secrets.dendrite_key = { secrets.dendrite_key = {
file = ../../secrets/dendrite_key.age; file = ../../secrets/dendrite_key.age;
owner = "dendrite"; owner = "dendrite";
}; };
}; };
users.users.dendrite = { users.users.dendrite = {
isSystemUser = true; isSystemUser = true;
group = "dendrite"; group = "dendrite";
}; };
users.groups.dendrite = {}; users.groups.dendrite = { };
systemd.services.dendrite.serviceConfig = { systemd.services.dendrite.serviceConfig = {
User = "dendrite"; User = "dendrite";
}; };
greg.databases.dendrite = {}; greg.databases.dendrite = { };
services.dendrite = { services.dendrite = {
enable = true; enable = true;
environmentFile = config.age.secrets.dendrite.path; environmentFile = config.age.secrets.dendrite.path;
httpPort = 8448; httpPort = 8448;
# Identify ourselves as the root of our own domain # Identify ourselves as the root of our own domain
settings = ( settings = (
(builtins.listToAttrs ( (builtins.listToAttrs (
(map (x: { name = x; value = { database.connection_string = conn; }; }) [ (map
"app_service_api" (x: {
"federation_api" name = x;
"key_server" value = {
"media_api" database.connection_string = conn;
"mscs" };
"relay_api" })
"room_server" [
"sync_api" "app_service_api"
]) "federation_api"
) ) // "key_server"
{ "media_api"
user_api.account_database.connection_string = conn; "mscs"
user_api.device_database.connection_string = conn; "relay_api"
global = { "room_server"
database = { "sync_api"
connection_string = conn; ]
max_open_conns = 25; )
max_idle_conns = 5; ))
conn_max_lifetime = -1; // {
}; user_api.account_database.connection_string = conn;
server_name = "thehellings.com"; user_api.device_database.connection_string = conn;
trusted_third_party_id_servers = [ global = {
"matrix.org" database = {
"vector.im" connection_string = conn;
"jupiterbroadcasting.com" max_open_conns = 25;
]; max_idle_conns = 5;
# Generate this with {path-to-dendrite}/bin/generate-keys --private-key /etc/dendrite.pem conn_max_lifetime = -1;
private_key = config.age.secrets.dendrite_key.path; };
}; server_name = "thehellings.com";
client_api = { trusted_third_party_id_servers = [
registration_enabled = false; "matrix.org"
registration_shared_secret = "\${REGISTRATION_SHARED_SECRET}"; "vector.im"
}; "jupiterbroadcasting.com"
}); ];
}; # Generate this with {path-to-dendrite}/bin/generate-keys --private-key /etc/dendrite.pem
private_key = config.age.secrets.dendrite_key.path;
};
client_api = {
registration_enabled = false;
registration_shared_secret = "\${REGISTRATION_SHARED_SECRET}";
};
}
);
};
systemd.services.dendrite = { systemd.services.dendrite = {
after = [ "postgresql.service" ]; after = [ "postgresql.service" ];
requires = [ "postgresql.service" ]; requires = [ "postgresql.service" ];
}; };
}; };
}; };
} }
+24 -23
View File
@@ -1,32 +1,33 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
minioPort = 9000; minioPort = 9000;
minioConsolePort = 9001; minioConsolePort = 9001;
in { in
environment.systemPackages = with pkgs; [ {
minio-client environment.systemPackages = with pkgs; [
xfsprogs minio-client
]; xfsprogs
];
greg.proxies."minio-01.thehellings.lan".target = "http://localhost:9000"; greg.proxies."minio-01.thehellings.lan".target = "http://localhost:9000";
fileSystems."/data/1" = { fileSystems."/data/1" = {
device = "/dev/disk/by-id/wwn-0x5000c500c48728e9-part1"; device = "/dev/disk/by-id/wwn-0x5000c500c48728e9-part1";
fsType = "xfs"; fsType = "xfs";
}; };
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
minioPort minioPort
minioConsolePort minioConsolePort
]; ];
age.secrets.minio.file = ../../secrets/minio.age; age.secrets.minio.file = ../../secrets/minio.age;
services.minio = { services.minio = {
enable = true; enable = true;
dataDir = [ "/data/1/minio" ]; dataDir = [ "/data/1/minio" ];
rootCredentialsFile = config.age.secrets.minio.path; rootCredentialsFile = config.age.secrets.minio.path;
browser = true; browser = true;
}; };
} }
+8 -8
View File
@@ -1,11 +1,11 @@
{ pkgs, ... }: { ... }:
{ {
wsl = { wsl = {
enable = true; enable = true;
wslConf.automount.root = "/mnt"; wslConf.automount.root = "/mnt";
defaultUser = "greg"; defaultUser = "greg";
startMenuLaunchers = true; startMenuLaunchers = true;
nativeSystemd = true; nativeSystemd = true;
}; };
} }
+99 -52
View File
@@ -1,60 +1,107 @@
{ pkgs, lib, ... }: {
pkgs,
config,
lib,
self,
...
}:
let let
notDarwin = (! pkgs.stdenv.isDarwin); builderHosts = (
lib.attrNames (lib.filterAttrs (_: v: v.config.greg.remote-builder.enable) self.nixosConfigurations)
);
in in
{ {
# Enable flakes # Enable flakes
nix = { nix = {
gc = { gc = {
automatic = true; automatic = true;
# Scheduling of them is different in nixos vs nix-darwin, so check for # Scheduling of them is different in nixos vs nix-darwin, so check for
# the extra details there # the extra details there
options = "--delete-older-than 30d"; options = "--delete-older-than 30d";
};
settings = {
experimental-features = "nix-command flakes";
keep-outputs = true;
keep-derivations = true;
min-free = (toString (1024 * 1024 * 1024) );
max-free = (toString (5 * 1024 * 1024 * 1024) );
substituters = [
"https://cache.garnix.io"
"https://ai.cachix.org"
];
trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc="
];
};
}; };
nixpkgs.config = { settings = {
allowUnfree = true; experimental-features = "nix-command flakes";
permittedInsecurePackages = [ keep-outputs = true;
"jitsi-meet-1.0.8043" keep-derivations = true;
]; min-free = (toString (1024 * 1024 * 1024));
max-free = (toString (5 * 1024 * 1024 * 1024));
trusted-users = [
"greg"
"gregory.hellings"
]; # For home and for work machines
substituters = [
"https://cache.garnix.io"
"https://ai.cachix.org"
"https://nixpkgs-python.cachix.org"
"https://greg-hellings.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"ai.cachix.org-1:N9dzRK+alWwoKXQlnn0H6aUx0lU/mspIoz8hMvGvbbc="
"nixpkgs-python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcNZLNS3ZAvfYNuYifcEU="
"greg-hellings.cachix.org-1:y01Jl/L5evlhxdnUW6n56AiI1k8g1wxWhTxJCe7XSco="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
}; };
# Base packages that need to be in all my hosts buildMachines = (
environment.systemPackages = with pkgs; [ lib.map (host: {
agenix hostName = "${host}-builder";
bitwarden-cli system = "x86_64-linux";
bmon protocol = "ssh-ng";
diffutils maxJobs = 12;
git speedFactor = 2;
gnupatch supportedFeatures = [
gregpy "nixos-test"
findutils "benchmark"
file "big-parallel"
hms # My own home manager switcher "kvm"
htop ];
iperf }) (lib.filter (x: x != config.networking.hostName) builderHosts)
killall );
nano distributedBuilds = true;
pciutils extraOptions = ''
pwgen builders-use-substitutes = true
unzip '';
wget };
];
programs.ssh.extraConfig = (
builtins.concatStringsSep "\n" (
lib.map (x: ''
Host ${x}-builder
Hostname ${x}.home
User remote-builder-user
'') builderHosts
)
);
nixpkgs.config = {
allowUnfree = true;
permittedInsecurePackages = [ "jitsi-meet-1.0.8043" ];
};
# Base packages that need to be in all my hosts
environment.systemPackages = with pkgs; [
agenix
bitwarden-cli
bmon
cachix
diffutils
git
gnupatch
gregpy
findutils
file
hms # My own home manager switcher
htop
iperf
killall
nano
pciutils
pwgen
unzip
wget
];
} }
+22 -24
View File
@@ -1,26 +1,24 @@
{...}: { ... }:
{ {
imports = [ imports = [ ../baseline.nix ];
../baseline.nix system.stateVersion = 4;
]; home-manager = {
system.stateVersion = 4; useGlobalPkgs = true;
home-manager = { users."gregory.hellings" = import ../../home/home.nix;
useGlobalPkgs = true; extraSpecialArgs = {
users."gregory.hellings" = import ../../home/home.nix; gnome = false;
extraSpecialArgs = { gui = false;
gnome = false; home = "/Users/gregory.hellings";
gui = false;
home = "/Users/gregory.hellings";
};
}; };
users.users."gregory.hellings".home = "/Users/gregory.hellings"; };
programs = { users.users."gregory.hellings".home = "/Users/gregory.hellings";
zsh.enable = true; programs = {
bash.enable = true; zsh.enable = true;
}; bash.enable = true;
services.nix-daemon.enable = true; };
nix = { services.nix-daemon.enable = true;
gc.interval.Hour = 24; nix = {
settings.auto-optimise-store = false; # Darwin bugs? gc.interval.Hour = 24;
}; settings.auto-optimise-store = false; # Darwin bugs?
} };
}
+7 -6
View File
@@ -1,7 +1,8 @@
let let
nixos = (import ./nixos); nixos = (import ./nixos);
darwin = (import ./darwin); darwin = (import ./darwin);
in { in
nixosModule = nixos; {
darwinModule = darwin; nixosModule = nixos;
} darwinModule = darwin;
}
+71 -60
View File
@@ -1,71 +1,82 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
let let
cfg = config.greg.backup; cfg = config.greg.backup;
where = j: "${config.services.syncthing.dataDir}/${j.dest}"; where = j: "${config.services.syncthing.dataDir}/${j.dest}";
makeSyncFolders = name: job: { makeSyncFolders = _: job: {
devices = [ "chronicles" ]; devices = [ "chronicles" ];
enable = true; enable = true;
id = job.id; id = job.id;
label = job.dest; label = job.dest;
path = where job; path = where job;
type = "sendonly"; type = "sendonly";
}; };
makeRestic = name: job: let makeRestic =
who = "${config.services.syncthing.user}:${config.services.syncthing.group}"; _: job:
in rec { let
initialize = true; who = "${config.services.syncthing.user}:${config.services.syncthing.group}";
passwordFile = config.age.secrets.restic-pw.path; in
paths = [ job.src ]; rec {
repository = where job; initialize = true;
backupCleanupCommand = ''${pkgs.coreutils}/bin/chown -R ${who} "${repository}"''; passwordFile = config.age.secrets.restic-pw.path;
}; paths = [ job.src ];
repository = where job;
backupCleanupCommand = ''${pkgs.coreutils}/bin/chown -R ${who} "${repository}"'';
};
in with lib; { in
options = { with lib;
greg.backup = { {
jobs = mkOption { options = {
default = {}; greg.backup = {
jobs = mkOption {
default = { };
type = with types; attrsOf (submodule ( type =
{ name, config, options, ... }: with types;
{ attrsOf (
options = { submodule (
src = mkOption { { ... }:
type = types.str; {
description = "Local path (string form) to backup from"; options = {
}; src = mkOption {
type = types.str;
description = "Local path (string form) to backup from";
};
dest = mkOption { dest = mkOption { type = types.str; };
type = types.str;
};
id = mkOption { id = mkOption {
type = types.str; type = types.str;
description = "The unique folder ID for this"; description = "The unique folder ID for this";
}; };
}; };
} }
)); )
}; );
}; };
}; };
};
config = mkIf ( ( attrValues cfg.jobs ) != [] ) config = mkIf ((attrValues cfg.jobs) != [ ]) {
{ age.secrets = {
age.secrets = { restic-pw.file = ../../secrets/restic-pw.age;
restic-pw.file = ../../secrets/restic-pw.age; restic-env.file = ../../secrets/restic-env.age;
restic-env.file = ../../secrets/restic-env.age; };
}; greg.syncthing = {
greg.syncthing = { enable = true;
enable = true; };
}; services = {
services = { syncthing.settings.folders = mapAttrs makeSyncFolders cfg.jobs;
syncthing.settings.folders = mapAttrs makeSyncFolders cfg.jobs; restic.backups = mapAttrs makeRestic cfg.jobs;
restic.backups = mapAttrs makeRestic cfg.jobs; };
}; };
};
} }
+643 -563
View File
File diff suppressed because it is too large Load Diff
+77 -65
View File
@@ -1,76 +1,88 @@
{ config, lib, inputs, overlays, ... }: {
config,
lib,
top,
overlays,
...
}:
let let
cfg = config.greg.containers; cfg = config.greg.containers;
# Create a container with all our default settings # Create a container with all our default settings
makeContainer = name: container: let makeContainer =
agekey = "/etc/ssh/agenix_key"; _: container:
in { let
autoStart = true; agekey = "/etc/ssh/agenix_key";
hostAddress = "192.168.${container.subnet}.1"; in
localAddress = "192.168.${container.subnet}.2"; {
privateNetwork = true; autoStart = true;
bindMounts = { hostAddress = "192.168.${container.subnet}.1";
"${agekey}".hostPath = "/etc/ssh/ssh_host_ed25519_key"; # This is needed for agenix to localAddress = "192.168.${container.subnet}.2";
}; privateNetwork = true;
enableTun = container.tailscale; bindMounts = {
config = { config, pkgs, ... }: { "${agekey}".hostPath = "/etc/ssh/ssh_host_ed25519_key"; # This is needed for agenix to
imports = [ };
inputs.agenix.nixosModules.default enableTun = container.tailscale;
inputs.self.modules.nixosModule config =
container.builder { ... }:
]; {
imports = [
top.agenix.nixosModules.default
top.self.modules.nixosModule
container.builder
];
nixpkgs.overlays = overlays; nixpkgs.overlays = overlays;
networking = { networking = {
firewall.enable = true; firewall.enable = true;
useHostResolvConf = lib.mkForce false; useHostResolvConf = lib.mkForce false;
}; };
age.identityPaths = [ agekey ]; age.identityPaths = [ agekey ];
greg.tailscale.enable = container.tailscale; greg.tailscale.enable = container.tailscale;
}; };
}; };
in { in
options.greg.containers = lib.mkOption { {
default = {}; options.greg.containers = lib.mkOption {
default = { };
type = with lib.types; attrsOf ( submodule ( type =
{ with lib.types;
options = { attrsOf (submodule ({
tailscale = lib.mkOption { options = {
type = bool; tailscale = lib.mkOption {
default = false; type = bool;
description = "Enable tailscale in the container"; default = false;
}; description = "Enable tailscale in the container";
subnet = lib.mkOption { };
type = str; subnet = lib.mkOption {
default = "200"; type = str;
}; default = "200";
builder = lib.mkOption { };
default = { ... }: {}; builder = lib.mkOption {
description = '' default = { ... }: { };
This needs to be a function, like the one for description = ''
a container's config. It will setup the core system above the This needs to be a function, like the one for
defaults set in this module. a container's config. It will setup the core system above the
''; defaults set in this module.
example = '' '';
{ pkgs, config, lib, ... } : example = ''
{ { pkgs, config, lib, ... } :
services.openssh.enable = true; {
} services.openssh.enable = true;
''; }
}; '';
}; };
} };
)); }));
}; };
config = { config = {
containers = builtins.mapAttrs makeContainer cfg; containers = builtins.mapAttrs makeContainer cfg;
}; };
} }
+69 -55
View File
@@ -1,63 +1,77 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
cfg = config.greg.databases; cfg = config.greg.databases;
dbs = (lib.attrNames cfg); dbs = (lib.attrNames cfg);
in { in
options.greg.databases = lib.mkOption { {
default = {}; options.greg.databases = lib.mkOption {
type = with lib.types; attrsOf ( submodule ( default = { };
{ name, config, options, ... }: { type =
# Options reserved for future expansion with lib.types;
options = {}; attrsOf (
} submodule (
)); { ... }:
}; {
# Options reserved for future expansion
options = { };
}
)
);
};
config = lib.mkIf ( dbs != [] ) { config = lib.mkIf (dbs != [ ]) {
services = { services = {
postgresql = { postgresql = {
enable = true; enable = true;
package = pkgs.postgresql_15; package = pkgs.postgresql_15;
checkConfig = true; checkConfig = true;
ensureDatabases = dbs; ensureDatabases = dbs;
ensureUsers = map (db: { name = db; ensureDBOwnership = true; }) dbs; ensureUsers = map (db: {
settings = { name = db;
log_connections = true; ensureDBOwnership = true;
log_statement = "all"; }) dbs;
logging_collector = true; settings = {
log_filename = "postgresql.log"; log_connections = true;
}; log_statement = "all";
identMap = "root root postgres"; logging_collector = true;
}; log_filename = "postgresql.log";
};
identMap = "root root postgres";
};
postgresqlBackup = { postgresqlBackup = {
enable = true; enable = true;
databases = dbs; databases = dbs;
}; };
logrotate = { logrotate = {
enable = true; enable = true;
settings = { settings = {
postgresqlBackup = { postgresqlBackup = {
enable = true; enable = true;
files = "${config.services.postgresqlBackup.location}/*.gz"; files = "${config.services.postgresqlBackup.location}/*.gz";
}; };
postgresLog = { postgresLog = {
enable = true; enable = true;
files = "/var/lib/postgresql/*/log/*.log"; files = "/var/lib/postgresql/*/log/*.log";
compress = true; compress = true;
compresscmd = "${pkgs.xz}/bin/xz"; compresscmd = "${pkgs.xz}/bin/xz";
}; };
}; };
}; };
}; };
greg.backup.jobs.greg-postgresql-backup = { greg.backup.jobs.greg-postgresql-backup = {
src = config.services.postgresqlBackup.location; src = config.services.postgresqlBackup.location;
dest = "database-${config.networking.hostName}"; dest = "database-${config.networking.hostName}";
id = "${config.networking.hostName}-postgres-backup"; id = "${config.networking.hostName}-postgres-backup";
}; };
}; };
} }
+95 -80
View File
@@ -1,92 +1,107 @@
{ config, pkgs, inputs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
x = if builtins.hasAttr "xonsh-unwrapped" pkgs then x = if builtins.hasAttr "xonsh-unwrapped" pkgs then pkgs.xonsh else pkgs.xonsh.passthru.wrapper;
pkgs.xonsh else in
pkgs.xonsh.passthru.wrapper; {
in { imports = [
imports = [ ../baseline.nix
../baseline.nix ./backup.nix
./backup.nix ./ceph.nix
./ceph.nix ./container.nix
./container.nix ./db.nix
./db.nix ./gnome.nix
./gnome.nix ./home.nix
./home.nix ./kde.nix
./kde.nix ./kiwix-serve.nix
./kiwix-serve.nix ./linode.nix
./linode.nix ./print.nix
./proxy.nix ./proxy.nix
./router.nix ./remote-builder.nix
./rpi4.nix ./router.nix
./sway.nix ./rpi4.nix
./syncthing.nix ./sway.nix
./tailscale.nix ./syncthing.nix
./vmdev.nix ./tailscale.nix
]; ./vmdev.nix
];
environment.sessionVariables.MOZ_ENABLE_WAYLAND = "0"; environment.systemPackages = with pkgs; [
environment.systemPackages = with pkgs; [ btrfs-progs
coreutils-full coreutils-full
direnv # needed for xonsh-direnv efibootmgr
efibootmgr psmisc
psmisc lshw
lshw usbutils
usbutils xfsprogs
]; ];
system.stateVersion = "24.05"; system.stateVersion = "24.05";
nix = { nix = {
gc.dates = "weekly"; gc.dates = "weekly";
settings.auto-optimise-store = true; settings.auto-optimise-store = true;
}; };
# I am a fan of network manager, myself # I am a fan of network manager, myself
networking = { networking = {
search = [ search = [
"thehellings.lan" "thehellings.lan"
"home" "home"
]; ];
networkmanager.enable = true; networkmanager.enable = true;
}; };
programs.xonsh = { programs.xonsh = {
enable = true; enable = true;
package = (x.override { package = (
extraPackages = (ps: with ps; [ x.override {
(ps.toPythonModule pkgs.pipenv) extraPackages = (
pyyaml ps: with ps; [
requests (ps.toPythonModule pkgs.pipenv)
ruamel-yaml pyyaml
xonsh-apipenv requests
pkgs.nur.repos.xonsh-xontribs.xonsh-direnv ruamel-yaml
pkgs.nur.repos.xonsh-xontribs.xontrib-vox xonsh-apipenv
]); pkgs.nur.repos.xonsh-xontribs.xonsh-direnv
}); pkgs.nur.repos.xonsh-xontribs.xontrib-vox
}; ]
);
}
);
};
# Enable the OpenSSH daemon for remote control # Enable the OpenSSH daemon for remote control
services = { services = {
openssh = { openssh = {
enable = true; enable = true;
settings.X11Forwarding = true; settings.X11Forwarding = true;
}; };
}; };
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.greg = { users.users.greg = {
isNormalUser = true; isNormalUser = true;
createHome = true; createHome = true;
extraGroups = [ "wheel" "networkmanager" ]; # Enable sudo for the user. extraGroups = [
shell = config.programs.xonsh.package; "wheel"
openssh.authorizedKeys.keys = lib.strings.splitString "\n" (builtins.readFile ../../home/ssh/authorized_keys); "networkmanager"
}; ]; # Enable sudo for the user.
shell = config.programs.xonsh.package;
openssh.authorizedKeys.keys = lib.strings.splitString "\n" (
builtins.readFile ../../home/ssh/authorized_keys
);
};
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
console = { console = {
font = "Lat2-Terminus16"; font = "Lat2-Terminus16";
keyMap = "us"; keyMap = "us";
}; };
} }
+56 -51
View File
@@ -1,64 +1,69 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.greg.gnome; cfg = config.greg.gnome;
in with lib; { in
options = { with lib;
greg.gnome.enable = mkEnableOption "Enable my default Gnome3 setup"; {
}; options = {
greg.gnome.enable = mkEnableOption "Enable my default Gnome3 setup";
};
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Sets up a basic Gnome installation # Sets up a basic Gnome installation
services = { services = {
accounts-daemon.enable = true; accounts-daemon.enable = true;
# Trackpad support # Trackpad support
libinput.enable = true; libinput.enable = true;
xserver = { xserver = {
enable = true; enable = true;
displayManager.gdm.enable = true; displayManager.gdm.enable = true;
desktopManager.gnome.enable = true; desktopManager.gnome.enable = true;
xkb.layout = "us"; xkb.layout = "us";
}; };
udev.packages = with pkgs; [ udev.packages = with pkgs; [ gnome-settings-daemon ];
gnome3.gnome-settings-daemon
];
pipewire.enable = true; pipewire.enable = true;
# Enablement for Firefox # Enablement for Firefox
gnome = { gnome = {
gnome-browser-connector.enable = true; gnome-browser-connector.enable = true;
#chrome-gnome-shell.enable = true; #chrome-gnome-shell.enable = true;
sushi.enable = true; sushi.enable = true;
gnome-online-accounts.enable = true; gnome-online-accounts.enable = true;
}; };
}; };
programs.dconf.enable = true; programs.dconf.enable = true;
xdg.portal = { xdg.portal = {
enable = true; enable = true;
wlr.enable = true; # Enables screen sharing in Wayland wlr.enable = true; # Enables screen sharing in Wayland
}; };
# Used by gsconnect # Used by gsconnect
networking.firewall.allowedTCPPorts = [ 1716 ]; networking.firewall.allowedTCPPorts = [ 1716 ];
# Enable some Gnome plugins that I like # Enable some Gnome plugins that I like
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
adwaita-icon-theme adwaita-icon-theme
gnome-tweaks gnome-tweaks
dconf-editor dconf-editor
gnomeExtensions.appindicator gnomeExtensions.appindicator
gnomeExtensions.clipboard-indicator gnomeExtensions.clipboard-indicator
gnomeExtensions.dash-to-dock gnomeExtensions.dash-to-dock
gnomeExtensions.gsconnect gnomeExtensions.gsconnect
gnomeExtensions.stocks-extension gnomeExtensions.stocks-extension
gnomeExtensions.tailscale-qs gnomeExtensions.tailscale-qs
gnomeExtensions.vitals gnomeExtensions.vitals
]; ];
}; };
} }
+12 -11
View File
@@ -1,18 +1,19 @@
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.greg.home; cfg = config.greg.home;
in with lib; in
with lib;
{ {
options.greg.home = mkOption { options.greg.home = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
description = "Sets the device up to be part of my home network"; description = "Sets the device up to be part of my home network";
}; };
config = mkIf cfg { config = mkIf cfg {
time.timeZone = "America/Chicago"; time.timeZone = "America/Chicago";
networking.domain = "thehellings.lan"; networking.domain = "thehellings.lan";
}; };
} }
+55 -40
View File
@@ -1,48 +1,63 @@
{ config, pkgs, lib, options, ... }: {
config,
pkgs,
lib,
options,
...
}:
let let
cfg = config.greg.kde; cfg = config.greg.kde;
in with lib; { in
options = { with lib;
greg.kde.enable = mkEnableOption "Enable my default KDE setup"; {
}; options = {
greg.kde.enable = mkEnableOption "Enable my default KDE setup";
};
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Sets up a basic KDE installation hardware = {
services = { bluetooth.enable = true;
xserver = { };
enable = true; # Sets up a basic KDE installation
xkb.layout = "us"; systemd.services.bluetooth.requiredBy = [ "multi-user.target" ];
# Trackpad support services =
libinput.enable = true; {
}; xserver = {
enable = true;
xkb.layout = "us";
# Trackpad support
};
pipewire = { libinput.enable = true;
enable = true; blueman.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
} // (optionalAttrs (builtins.hasAttr "plasma6" options.services.xserver.desktopManager) {
desktopManager.plasma6.enable = true;
displayManager = {
defaultSession = "plasma";
sddm.enable = true;
};
});
programs.dconf.enable = true; pipewire = {
programs.sway.enable = true; # Gives us Wayland enable = true;
xdg.portal = { alsa.enable = true;
enable = true; alsa.support32Bit = true;
wlr.enable = true; # Enables screen sharing in Wayland pulse.enable = true;
}; };
}
// (optionalAttrs (builtins.hasAttr "plasma6" options.services.xserver.desktopManager) {
desktopManager.plasma6.enable = true;
displayManager = {
defaultSession = "plasma";
sddm.enable = true;
};
});
environment.systemPackages = with pkgs; [ programs.dconf.enable = true;
kalendar programs.sway.enable = true; # Gives us Wayland
korganizer xdg.portal = {
plasma-pa enable = true;
]; wlr.enable = true; # Enables screen sharing in Wayland
}; };
environment.systemPackages = with pkgs; [
kalendar
korganizer
];
};
} }
+46 -40
View File
@@ -1,48 +1,54 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.services.kiwix-serve; cfg = config.services.kiwix-serve;
in with lib; { in
options.services.kiwix-serve = { with lib;
enable = mkEnableOption "Enable the Kiwix web server"; {
options.services.kiwix-serve = {
enable = mkEnableOption "Enable the Kiwix web server";
port = mkOption { port = mkOption {
type = types.int; type = types.int;
default = 8888; default = 8888;
description = "Port to serve the Kiwix HTTP service on"; description = "Port to serve the Kiwix HTTP service on";
}; };
path = mkOption { path = mkOption {
type = types.str; type = types.str;
default = "/var/lib/kiwix-serve/"; default = "/var/lib/kiwix-serve/";
description = "Path to Zim file(s) to serve"; description = "Path to Zim file(s) to serve";
}; };
proxy = mkOption { proxy = mkOption {
type = types.str; type = types.str;
default = ""; default = "";
description = ''Upstream proxy, if any, to configure with kiwix. Specify description = ''
host and port. E.g. "localhost:8080" Upstream proxy, if any, to configure with kiwix. Specify
''; host and port. E.g. "localhost:8080"
}; '';
}; };
};
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = [ environment.systemPackages = [ pkgs.kiwix-tools ];
pkgs.kiwix-tools
];
systemd.services.kiwix-serve = { systemd.services.kiwix-serve = {
enable = true; enable = true;
after = [ "network.service" ]; after = [ "network.service" ];
description = "Runs the kiwix-serve binary as a sysmted service"; description = "Runs the kiwix-serve binary as a sysmted service";
restartTriggers = [ pkgs.kiwix-tools ]; restartTriggers = [ pkgs.kiwix-tools ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
script = "${pkgs.kiwix-tools}/bin/kiwix-serve --port ${toString cfg.port} ${cfg.path}"; script = "${pkgs.kiwix-tools}/bin/kiwix-serve --port ${toString cfg.port} ${cfg.path}";
environment = { environment = {
UPSTREAM_HOST = mkIf (cfg.proxy != "") cfg.proxy; UPSTREAM_HOST = mkIf (cfg.proxy != "") cfg.proxy;
UPSTREAM_WIKI = mkIf (cfg.proxy != "") cfg.proxy; UPSTREAM_WIKI = mkIf (cfg.proxy != "") cfg.proxy;
}; };
}; };
}; };
} }
+40 -34
View File
@@ -1,44 +1,50 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
cfg = config.greg.linode; cfg = config.greg.linode;
in with lib; in
with lib;
{ {
options.greg.linode = { options.greg.linode = {
enable = mkEnableOption "Set sensible defaults for a Linode host"; enable = mkEnableOption "Set sensible defaults for a Linode host";
bootTimeout = mkOption { bootTimeout = mkOption {
type = types.int; type = types.int;
default = 15; default = 15;
description = "Set bootloader timeout in seconds."; description = "Set bootloader timeout in seconds.";
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Enables connection over Linode consoles # Enables connection over Linode consoles
boot.kernelParams = [ "console=ttyS0,19200n8" ]; boot.kernelParams = [ "console=ttyS0,19200n8" ];
boot.loader.grub = { boot.loader.grub = {
device = "nodev"; device = "nodev";
extraConfig = '' extraConfig = ''
serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1; serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1;
terminal_input serial; terminal_input serial;
terminal_output serial; terminal_output serial;
''; '';
}; };
# Tells grub to ignore partion-free device warnings, since we are on Linode # Tells grub to ignore partion-free device warnings, since we are on Linode
boot.loader.timeout = 15; boot.loader.timeout = 15;
networking.usePredictableInterfaceNames = false; # Use old style eth0 names networking.usePredictableInterfaceNames = false; # Use old style eth0 names
networking.useDHCP = false; networking.useDHCP = false;
networking.interfaces.eth0.useDHCP = true; networking.interfaces.eth0.useDHCP = true;
# Suggested diagnostic tools # Suggested diagnostic tools
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
inetutils inetutils
mtr mtr
sysstat sysstat
]; ];
}; };
} }
+39
View File
@@ -0,0 +1,39 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.greg.print;
in
with lib;
{
options.greg.print.enable = mkOption {
type = types.bool;
default = true;
description = "Configures the system to print with my home printer";
};
config = mkIf cfg.enable {
# ipp://printer.thehellings.lan:631/ - generic postscript printer
services.printing = {
enable = true;
drivers = with pkgs; [ gutenprint ] ++ (lib.optional pkgs.stdenv.isx86_64 gutenprintBin);
};
hardware.printers.ensurePrinters = [
{
name = "HomeLexmarkColorPrinter";
location = "Home office";
deviceUri = "ipp://printer.thehellings.lan:631/";
model = "drv:///sample.drv/generic.ppd";
ppdOptions = {
PageSize = "Letter";
};
}
];
};
}

Some files were not shown because too many files have changed in this diff Show More