refactor: cleaned up nixos and home dirs

This commit is contained in:
Nick 2025-02-06 14:27:52 -06:00
parent 824a91d405
commit e596e1c1b3
582 changed files with 2 additions and 22 deletions

View file

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

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

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

View file

@ -0,0 +1,44 @@
{ flake, config, ... }:
let
inherit (flake.config.people)
user0
user1
user2
;
inherit (flake.config.machines)
devices
;
hostname = config.networking.hostName;
desktop = devices.desktop.name;
server = devices.server.name;
fallaryn = devices.fallaryn.name;
bartholomew = devices.bartholomew.name;
in
{
security = {
doas = {
enable = true;
extraRules = [
{
keepEnv = true;
noPass = true;
users = [
(
if hostname == desktop then
user0
else if hostname == server then
user0
else if hostname == bartholomew then
user1
else if hostname == fallaryn then
user2
else
""
)
];
}
];
};
# 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,3 @@
{
services.flatpak.enable = true;
}

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 = "backup";
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,44 @@
{
flake,
config,
...
}:
let
inherit (flake.config.people)
user0
user1
user2
;
inherit (flake.config.people.users.${userLogic})
sshKeys
;
inherit (flake.config.machines)
devices
;
hostname = config.networking.hostName;
desktop = devices.desktop.name;
server = devices.server.name;
fallaryn = devices.fallaryn.name;
bartholomew = devices.bartholomew.name;
userLogic =
if hostname == desktop then
user0
else if hostname == server then
user0
else if hostname == fallaryn then
user2
else
"";
in
{
users.users =
if hostname == bartholomew then
{ }
else
{
${userLogic} = {
openssh.authorizedKeys.keys = sshKeys;
};
};
}

View file

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

View file

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