1
0
Fork 0
This commit is contained in:
Aires 2024-05-01 21:10:26 -04:00
parent 2667732682
commit d8743f1549
18 changed files with 151 additions and 157 deletions

View file

@ -117,11 +117,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1714430505, "lastModified": 1714515075,
"narHash": "sha256-SSJQ/KOy8uISnoZgqDoRha7g7PFLSFP/BtMWm0wUz8Q=", "narHash": "sha256-azMK7aWH0eUc3IqU4Fg5rwZdB9WZBvimOGG3piqvtsY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "f8e6694edabe4aaa7a85aac47b43ea5d978b116d", "rev": "6d3b6dc9222c12b951169becdf4b0592ee9576ef",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -18,7 +18,7 @@
kdeconnect.enable = true; kdeconnect.enable = true;
media.enable = true; media.enable = true;
office.enable = true; office.enable = true;
pandoc.enable = true; writing.enable = true;
}; };
ui = { ui = {
flatpak.enable = true; flatpak.enable = true;

View file

@ -32,8 +32,8 @@ in
kdeconnect.enable = true; kdeconnect.enable = true;
media.enable = true; media.enable = true;
office.enable = true; office.enable = true;
pandoc.enable = true;
recording.enable = true; recording.enable = true;
writing.enable = true;
}; };
ui = { ui = {
flatpak.enable = true; flatpak.enable = true;

View file

@ -6,7 +6,7 @@
./kdeconnect.nix ./kdeconnect.nix
./media.nix ./media.nix
./office.nix ./office.nix
./pandoc.nix
./recording.nix ./recording.nix
./writing.nix
]; ];
} }

View file

@ -26,6 +26,7 @@ with lib;
kubectl kubectl
kubernetes-helm kubernetes-helm
kubevirt # Virtctl command-line tool kubevirt # Virtctl command-line tool
statix # Nix linting tool
]; ];
}) })
]; ];

View file

@ -16,13 +16,5 @@ with lib;
"org.libreoffice.LibreOffice" "org.libreoffice.LibreOffice"
"us.zoom.Zoom" "us.zoom.Zoom"
]; ];
# Spelling and grammer checking: hosted on localhost:8081
services.languagetool = {
enable = true;
port = 8090;
public = false;
allowOrigin = "*";
};
}; };
} }

View file

@ -1,20 +0,0 @@
{ pkgs, config, lib, ... }:
let
cfg = config.host.apps.pandoc;
in
with lib;
{
options = {
host.apps.pandoc.enable = mkEnableOption (mdDoc "Enables pandoc");
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
haskellPackages.pandoc
haskellPackages.pandoc-cli
haskellPackages.pandoc-crossref
texliveSmall
];
};
}

29
modules/apps/writing.nix Normal file
View file

@ -0,0 +1,29 @@
{ pkgs, config, lib, ... }:
let
cfg = config.host.apps.writing;
in
with lib;
{
options = {
host.apps.writing.enable = mkEnableOption (mdDoc "Enables writing and editing tools");
};
config = mkIf cfg.enable {
# Install packages for building ebooks
environment.systemPackages = with pkgs; [
haskellPackages.pandoc
haskellPackages.pandoc-cli
haskellPackages.pandoc-crossref
texliveSmall
];
# Spelling and grammer checking: hosted on localhost:8081
services.languagetool = {
enable = true;
port = 8090;
public = false;
allowOrigin = "*";
};
};
}

View file

@ -4,6 +4,7 @@
./bootloader.nix ./bootloader.nix
./network.nix ./network.nix
./nix.nix ./nix.nix
./programs.nix
./shell.nix ./shell.nix
./system.nix ./system.nix
]; ];

View file

@ -5,8 +5,6 @@ _: {
# Enable firewall # Enable firewall
nftables.enable = true; nftables.enable = true;
firewall = { firewall.enable = true;
enable = true;
};
}; };
} }

29
modules/base/programs.nix Normal file
View file

@ -0,0 +1,29 @@
# Set up program defaults
{ config, ... }: {
# Set up base apps
programs = {
direnv.enable = true;
nano = {
enable = true;
syntaxHighlight = true;
nanorc = ''
set linenumbers
set tabsize 4
set softwrap
'';
};
nh = {
enable = true;
flake = "${config.users.users.aires.home}/Development/nix-configuration";
# Alternative garbage collection system to nix.gc.automatic
clean = {
enable = true;
dates = "daily";
extraArgs = "--keep-since 7d --keep 10"; # Keep the last 10 entries
};
};
};
}

View file

@ -1,18 +1,12 @@
{ pkgs, config, lib, inputs, ... }:
# System options # System options
let { pkgs, config, ... }: {
cfg = config.host.system;
in
with lib;
{
config = {
# Set up the environment # Set up the environment
environment = { environment = {
# Install base packages # Install base packages
systemPackages = with pkgs; [ systemPackages = with pkgs; [
bash bash
dconf # Needed to fix an issue with Home-manager. See https://github.com/nix-community/home-manager/issues/3113 dconf # Needed to fix an issue with Home-manager. See https://github.com/nix-community/home-manager/issues/3113
direnv
git git
home-manager home-manager
nano nano
@ -24,30 +18,19 @@ with lib;
variables = { variables = {
EDITOR = "nano"; # Set default editor to nano EDITOR = "nano"; # Set default editor to nano
}; };
# System configuration file overrides
etc = {
# Reduce systemd logout time to 30s
"systemd/system.conf.d/10-reduce-logout-wait-time.conf" = {
text = ''
[Manager]
DefaultTimeoutStopSec=30s
'';
};
};
}; };
# Configure automatic updates # Configure automatic updates
system = { system.autoUpgrade = {
# Enable automatic updates
autoUpgrade = {
enable = true; enable = true;
flake = "${config.users.users.aires.home}/Development/nix-configuration"; flake = "${config.users.users.aires.home}/Development/nix-configuration";
dates = "daily"; dates = "daily";
allowReboot = false; allowReboot = false;
operation = "boot"; # Don't switch, just create a boot entry operation = "boot"; # Don't switch, just create a boot entry
}; };
};
# Enable fwupd (firmware updater)
services.fwupd.enable = true;
# Set your time zone. # Set your time zone.
time.timeZone = "America/New_York"; time.timeZone = "America/New_York";
@ -68,54 +51,4 @@ with lib;
LC_TIME = "en_US.UTF-8"; LC_TIME = "en_US.UTF-8";
}; };
}; };
# Set up base apps
programs = {
direnv.enable = true;
nano = {
enable = true;
syntaxHighlight = true;
nanorc = ''
set linenumbers
set tabsize 4
set softwrap
'';
};
nh = {
enable = true;
flake = "/home/aires/Development/nix-configuration";
# Alternative garbage collection system to nix.gc.automatic
clean = {
enable = true;
dates = "daily";
extraArgs = "--keep-since 7d --keep 10"; # Keep the last 10 entries
};
};
};
services = {
# Scrub BTRFS partitions if the root partition is btrfs
btrfs.autoScrub = lib.mkIf (config.fileSystems."/".fsType == "btrfs") {
enable = true;
interval = "weekly";
fileSystems = [ "/" ];
};
# Enable fwupd (firmware updater)
fwupd.enable = true;
# Allow systemd user services to keep running after the user has logged out
logind.killUserProcesses = false;
# Enable SMART monitoring
smartd = {
enable = true;
autodetect = true;
notifications.wall.enable = true;
};
};
};
} }

View file

@ -8,7 +8,6 @@ in
config = mkIf (role == "server") { config = mkIf (role == "server") {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
direnv
htop htop
]; ];
}; };

View file

@ -14,11 +14,6 @@ in
flatpak.enable = true; flatpak.enable = true;
}; };
environment.systemPackages = with pkgs; [
direnv
statix # Nix linting tool
];
boot = { boot = {
# Enable Plymouth # Enable Plymouth
plymouth.enable = true; plymouth.enable = true;

View file

@ -0,0 +1,9 @@
# Services to run on BTRFS filesystems.
# Only run if the root partition is BTRFS.
{ config, lib, ... }: {
services.btrfs.autoScrub = lib.mkIf (config.fileSystems."/".fsType == "btrfs") {
enable = true;
interval = "weekly";
fileSystems = [ "/" ];
};
}

View file

@ -1,8 +1,11 @@
{ ... }: { { ... }: {
imports = [ imports = [
./apcupsd.nix ./apcupsd.nix
./btrfs.nix
./duplicacy-web.nix ./duplicacy-web.nix
./k3s.nix ./k3s.nix
./msmtp.nix ./msmtp.nix
./smartd.nix
./systemd.nix
]; ];
} }

View file

@ -0,0 +1,8 @@
# Configure SMART monitoring
_: {
services.smartd = {
enable = true;
autodetect = true;
notifications.wall.enable = true;
};
}

View file

@ -0,0 +1,17 @@
# Configure systemD
_: {
services = {
# Allow systemd user services to keep running after the user has logged out
logind.killUserProcesses = false;
};
# Reduce systemd logout time to 30s
environment.etc = {
"systemd/system.conf.d/10-reduce-logout-wait-time.conf" = {
text = ''
[Manager]
DefaultTimeoutStopSec=30s
'';
};
};
}