feat: init

This commit is contained in:
Nick 2025-03-29 23:08:26 -05:00
commit 96c6f790fc
804 changed files with 33411 additions and 0 deletions

View file

@ -0,0 +1,3 @@
{
services.accounts-daemon.enable = true;
}

11
modules/nixos/core/default.nix Executable file
View file

@ -0,0 +1,11 @@
let
importList =
let
content = builtins.readDir ./.;
dirContent = builtins.filter (n: content.${n} == "directory") (builtins.attrNames content);
in
map (name: ./. + "/${name}") dirContent;
in
{
imports = importList;
}

View file

@ -0,0 +1,57 @@
{
flake,
config,
...
}:
let
inherit (flake.config.people)
user0
user1
user2
user3
;
inherit (flake.config.machines)
devices
;
hostname = config.networking.hostName;
mars = devices.mars.name;
ceres = devices.ceres.name;
venus = devices.venus.name;
charon = devices.charon.name;
deimos = devices.deimos.name;
userLogic =
if
builtins.elem hostname [
mars
deimos
ceres
]
then
[
user0
user1
user3
]
else if hostname == charon then
[ user1 ]
else if hostname == venus then
[ user2 ]
else
[ ];
in
{
security = {
doas = {
enable = true;
extraRules = [
{
keepEnv = true;
noPass = true;
users = userLogic;
}
];
};
# sudo.enable = false;
};
}

View file

@ -0,0 +1,30 @@
{
pkgs,
config,
...
}:
{
environment = {
enableAllTerminfo = true;
systemPackages = builtins.attrValues {
inherit (pkgs)
git
grim
pijul
sshfs
tomb
just
virt-manager
;
};
variables = {
VIDEO_PLAYER = "mpv";
EDITOR = "hx";
TERM = "ghostty";
NIXPKGS_ALLOW_INSECURE = "1";
NIXPKGS_ALLOW_UNFREE = "1";
GTK_THEME = "catppuccin-macchiato-mauve-compact";
# ANTHROPIC_API_KEY = config.sops.secrets.claude-api-key.path;
};
};
}

View file

@ -0,0 +1,107 @@
{
pkgs,
flake,
...
}:
let
inherit (flake.config.aesthetics.themes)
fonts
;
in
{
fonts = {
fontconfig = {
enable = true;
defaultFonts = {
serif = [
fonts.names.name0
];
monospace = [
fonts.names.name0
];
sansSerif = [
fonts.names.name0
];
emoji = [
"Noto Fonts Color Emoji"
];
};
antialias = true;
};
packages = builtins.attrValues {
inherit (pkgs)
noto-fonts-color-emoji
dosis
iosevka
;
inherit (pkgs.nerd-fonts)
_0xproto
_3270
agave
anonymice
arimo
aurulent-sans-mono
bigblue-terminal
bitstream-vera-sans-mono
blex-mono
caskaydia-cove
caskaydia-mono
code-new-roman
comic-shanns-mono
commit-mono
cousine
d2coding
daddy-time-mono
dejavu-sans-mono
departure-mono
droid-sans-mono
envy-code-r
fantasque-sans-mono
fira-code
fira-mono
geist-mono
go-mono
gohufont
hack
hasklug
heavy-data
hurmit
im-writing
inconsolata
inconsolata-go
inconsolata-lgc
intone-mono
iosevka-term
iosevka-term-slab
jetbrains-mono
lekton
liberation
lilex
martian-mono
monaspace
monofur
monoid
mononoki
mplus
noto
open-dyslexic
overpass
profont
proggy-clean-tt
recursive-mono
roboto-mono
sauce-code-pro
shure-tech-mono
space-mono
symbols-only
terminess-ttf
tinos
ubuntu
ubuntu-mono
ubuntu-sans
victor-mono
zed-mono
;
};
};
}

View file

@ -0,0 +1,13 @@
{ flake, ... }:
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "backup5";
extraSpecialArgs = {
inherit
flake
;
};
};
}

View file

@ -0,0 +1,30 @@
{
time.timeZone = "America/Winnipeg";
i18n =
let
locale = "en_CA.UTF-8";
in
{
defaultLocale = locale;
extraLocaleSettings = builtins.listToAttrs (
map
(option: {
name = option;
value = locale;
})
[
"LC_ADDRESS"
"LC_IDENTIFICATION"
"LC_MEASUREMENT"
"LC_MONETARY"
"LC_NAME"
"LC_NUMERIC"
"LC_PAPER"
"LC_TELEPHONE"
"LC_TIME"
]
);
};
}

View file

@ -0,0 +1,5 @@
{
programs.nh = {
enable = true;
};
}

View file

@ -0,0 +1,47 @@
{
config,
lib,
...
}:
{
nixpkgs = {
config = {
allowUnfree = true;
permittedInsecurePackages = [
"electron-unwrapped-33.0.2"
"electron-31.7.7"
"electron-27.3.11"
"olm-3.2.16"
];
};
};
nix = {
extraOptions = ''
experimental-features = nix-command flakes
keep-outputs = true
keep-derivations = true
'';
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 10d";
};
settings = {
substituters = [
];
trusted-public-keys = [
];
};
};
# Print package list
environment.etc."current-system-packages".text =
let
packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
sortedUnique = builtins.sort builtins.lessThan (lib.unique packages);
formatted = builtins.concatStringsSep "\n" sortedUnique;
in
formatted;
}

View file

@ -0,0 +1,3 @@
{
services.rsyncd.enable = true;
}

View file

@ -0,0 +1,58 @@
{
flake,
config,
...
}:
let
inherit (flake.config.people)
user0
user1
user2
user3
;
inherit (flake.config.machines)
devices
;
hostname = config.networking.hostName;
mars = devices.mars.name;
deimos = devices.deimos.name;
ceres = devices.ceres.name;
venus = devices.venus.name;
charon = devices.charon.name;
# Helper function to get SSH keys for a specific user
getUserKeys = user: flake.config.people.users.${user}.sshKeys;
in
{
users.users =
if hostname == charon then
{ }
else if hostname == mars then
{
${user0} = {
openssh.authorizedKeys.keys = getUserKeys user0;
};
${user3} = {
openssh.authorizedKeys.keys = getUserKeys user3;
};
}
else if
builtins.elem hostname [
deimos
ceres
]
then
{
${user0} = {
openssh.authorizedKeys.keys = getUserKeys user0;
};
}
else if hostname == venus then
{
${user2} = {
openssh.authorizedKeys.keys = getUserKeys user2;
};
}
else
{ };
}

View file

@ -0,0 +1,5 @@
{
services.sysstat = {
enable = true;
};
}

View file

@ -0,0 +1 @@
_: { }