Format nix files using new formatter
This commit is contained in:
parent
5c61f322dc
commit
f8ecef5850
20
flake.nix
20
flake.nix
|
@ -2,8 +2,7 @@
|
||||||
description = "System configuration for panacea";
|
description = "System configuration for panacea";
|
||||||
|
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
extra-substituters =
|
extra-substituters = "https://cachix.cachix.org https://nix-community.cachix.org";
|
||||||
"https://cachix.cachix.org https://nix-community.cachix.org";
|
|
||||||
extra-trusted-public-keys = ''
|
extra-trusted-public-keys = ''
|
||||||
cachix.cachix.org-1:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM=
|
cachix.cachix.org-1:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM=
|
||||||
nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs='';
|
nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs='';
|
||||||
|
@ -34,7 +33,8 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, ... }@inputs:
|
outputs =
|
||||||
|
{ self, nixpkgs, ... }@inputs:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
@ -43,16 +43,22 @@
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
overlays = [
|
overlays = [
|
||||||
(final: prev: {
|
(final: prev: {
|
||||||
emacs-vterm =
|
emacs-vterm = (
|
||||||
((pkgs.emacsPackagesFor pkgs.emacs29-pgtk).emacsWithPackages
|
(pkgs.emacsPackagesFor pkgs.emacs29-pgtk).emacsWithPackages (
|
||||||
(epkgs: with epkgs; [ vterm mu4e ]));
|
epkgs: with epkgs; [
|
||||||
|
vterm
|
||||||
|
mu4e
|
||||||
|
]
|
||||||
|
)
|
||||||
|
);
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
lib = nixpkgs.lib;
|
lib = nixpkgs.lib;
|
||||||
|
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
nixosConfigurations.panacea = lib.nixosSystem {
|
nixosConfigurations.panacea = lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
modules = [
|
modules = [
|
||||||
|
|
|
@ -5,9 +5,9 @@ let
|
||||||
folder = ../cachix;
|
folder = ../cachix;
|
||||||
toImport = name: value: folder + ("/" + name);
|
toImport = name: value: folder + ("/" + name);
|
||||||
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
|
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
|
||||||
imports = lib.mapAttrsToList toImport
|
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
|
||||||
(lib.filterAttrs filterCaches (builtins.readDir folder));
|
in
|
||||||
in {
|
{
|
||||||
inherit imports;
|
inherit imports;
|
||||||
nix.binaryCaches = [ "https://cache.nixos.org/" ];
|
nix.binaryCaches = [ "https://cache.nixos.org/" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
# Improve nix-shell and direnv integration
|
# Improve nix-shell and direnv integration
|
||||||
|
|
|
@ -1,56 +1,66 @@
|
||||||
# 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,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" ];
|
boot.initrd.availableKernelModules = [
|
||||||
|
"nvme"
|
||||||
|
"xhci_pci"
|
||||||
|
"usbhid"
|
||||||
|
];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" = {
|
||||||
{ device = "syscea/stateful/root";
|
device = "syscea/stateful/root";
|
||||||
fsType = "zfs";
|
fsType = "zfs";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/nix" =
|
fileSystems."/nix" = {
|
||||||
{ device = "syscea/ephemeral/nix";
|
device = "syscea/ephemeral/nix";
|
||||||
fsType = "zfs";
|
fsType = "zfs";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/ugent" =
|
fileSystems."/ugent" = {
|
||||||
{ device = "systemd-1";
|
device = "systemd-1";
|
||||||
fsType = "autofs";
|
fsType = "autofs";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/home/coolneng" =
|
fileSystems."/home/coolneng" = {
|
||||||
{ device = "syscea/stateful/home";
|
device = "syscea/stateful/home";
|
||||||
fsType = "zfs";
|
fsType = "zfs";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/tmp" =
|
fileSystems."/tmp" = {
|
||||||
{ device = "syscea/ephemeral/tmp";
|
device = "syscea/ephemeral/tmp";
|
||||||
fsType = "zfs";
|
fsType = "zfs";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/home/coolneng/Downloads" =
|
fileSystems."/home/coolneng/Downloads" = {
|
||||||
{ device = "syscea/stateful/home/downloads";
|
device = "syscea/stateful/home/downloads";
|
||||||
fsType = "zfs";
|
fsType = "zfs";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" =
|
fileSystems."/boot" = {
|
||||||
{ device = "/dev/disk/by-uuid/C374-A2FD";
|
device = "/dev/disk/by-uuid/C374-A2FD";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices =
|
swapDevices = [
|
||||||
[ { device = "/dev/disk/by-uuid/1231a42f-a71a-4c67-b4d8-7506c02a8328"; }
|
{ device = "/dev/disk/by-uuid/1231a42f-a71a-4c67-b4d8-7506c02a8328"; }
|
||||||
];
|
];
|
||||||
|
|
||||||
# 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,4 +1,9 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
|
||||||
|
@ -6,13 +11,14 @@ let
|
||||||
sender = "akasroua@disroot.org";
|
sender = "akasroua@disroot.org";
|
||||||
recipient = "akasroua+smart@disroot.org";
|
recipient = "akasroua+smart@disroot.org";
|
||||||
|
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
# Notify when a disk starts going haywire
|
# Notify when a disk starts going haywire
|
||||||
services.smartd = {
|
services.smartd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaults.monitored = "-H -f -t -C 197 -U 198 -d nvme";
|
defaults.monitored = "-H -f -t -C 197 -U 198 -d nvme";
|
||||||
autodetect = false;
|
autodetect = false;
|
||||||
devices = [{ device = "/dev/nvme0"; }];
|
devices = [ { device = "/dev/nvme0"; } ];
|
||||||
notifications.mail = {
|
notifications.mail = {
|
||||||
enable = true;
|
enable = true;
|
||||||
sender = sender;
|
sender = sender;
|
||||||
|
|
|
@ -1,8 +1,15 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let wireguard_port = "1194";
|
let
|
||||||
|
wireguard_port = "1194";
|
||||||
|
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
# Set hostname, hostid and enable WiFi
|
# Set hostname, hostid and enable WiFi
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "panacea";
|
hostName = "panacea";
|
||||||
|
@ -77,11 +84,13 @@ in {
|
||||||
PrivateKeyFile = config.age.secrets.wireguard.path;
|
PrivateKeyFile = config.age.secrets.wireguard.path;
|
||||||
FirewallMark = 34952;
|
FirewallMark = 34952;
|
||||||
};
|
};
|
||||||
wireguardPeers = [{
|
wireguardPeers = [
|
||||||
PublicKey = "GN8lqPBZYOulh6xD4GhkoEWI65HMMCpSxJSH5871YnU=";
|
{
|
||||||
AllowedIPs = [ "0.0.0.0/0" ];
|
PublicKey = "GN8lqPBZYOulh6xD4GhkoEWI65HMMCpSxJSH5871YnU=";
|
||||||
Endpoint = "coolneng.duckdns.org:1194";
|
AllowedIPs = [ "0.0.0.0/0" ];
|
||||||
}];
|
Endpoint = "coolneng.duckdns.org:1194";
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
systemd.network.networks."wg0" = {
|
systemd.network.networks."wg0" = {
|
||||||
matchConfig.Name = "wg0";
|
matchConfig.Name = "wg0";
|
||||||
|
@ -90,20 +99,22 @@ in {
|
||||||
Address = "10.8.0.2/32";
|
Address = "10.8.0.2/32";
|
||||||
DNS = "10.8.0.1";
|
DNS = "10.8.0.1";
|
||||||
DNSDefaultRoute = true;
|
DNSDefaultRoute = true;
|
||||||
Domains = "~.";
|
|
||||||
MulticastDNS = "yes";
|
|
||||||
};
|
};
|
||||||
routingPolicyRules = [{
|
routingPolicyRules = [
|
||||||
FirewallMark = 34952;
|
{
|
||||||
InvertRule = true;
|
FirewallMark = 34952;
|
||||||
Table = 1000;
|
InvertRule = true;
|
||||||
Priority = 10;
|
Table = 1000;
|
||||||
}];
|
Priority = 10;
|
||||||
routes = [{
|
}
|
||||||
Gateway = "10.8.0.1";
|
];
|
||||||
GatewayOnLink = true;
|
routes = [
|
||||||
Table = 1000;
|
{
|
||||||
}];
|
Gateway = "10.8.0.1";
|
||||||
|
GatewayOnLink = true;
|
||||||
|
Table = 1000;
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Firewall configuration
|
# Firewall configuration
|
||||||
|
|
|
@ -1,14 +1,26 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
|
||||||
let isync-oauth2 = (isync.override { withCyrusSaslXoauth2 = true; });
|
let
|
||||||
|
isync-oauth2 = (isync.override { withCyrusSaslXoauth2 = true; });
|
||||||
|
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
# Upgrade Doom Emacs daily
|
# Upgrade Doom Emacs daily
|
||||||
systemd.user.services.doom-upgrade = {
|
systemd.user.services.doom-upgrade = {
|
||||||
description = "Upgrade Doom Emacs";
|
description = "Upgrade Doom Emacs";
|
||||||
path = [ bash emacs-vterm git coreutils ];
|
path = [
|
||||||
|
bash
|
||||||
|
emacs-vterm
|
||||||
|
git
|
||||||
|
coreutils
|
||||||
|
];
|
||||||
script = ''
|
script = ''
|
||||||
${pkgs.bash}/bin/bash -c "/home/coolneng/.emacs.d/bin/doom -! upgrade"
|
${pkgs.bash}/bin/bash -c "/home/coolneng/.emacs.d/bin/doom -! upgrade"
|
||||||
'';
|
'';
|
||||||
|
@ -20,7 +32,10 @@ in {
|
||||||
# Upgrade Neovim plugins weekly
|
# Upgrade Neovim plugins weekly
|
||||||
systemd.user.services.vim-plug-upgrade = {
|
systemd.user.services.vim-plug-upgrade = {
|
||||||
description = "Upgrade Vim-Plug";
|
description = "Upgrade Vim-Plug";
|
||||||
path = [ git neovim ];
|
path = [
|
||||||
|
git
|
||||||
|
neovim
|
||||||
|
];
|
||||||
script = "${pkgs.neovim}/bin/nvim +PlugUpgrade +PlugUpdate +qa";
|
script = "${pkgs.neovim}/bin/nvim +PlugUpgrade +PlugUpdate +qa";
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
startAt = "Wed 18:00:00";
|
startAt = "Wed 18:00:00";
|
||||||
|
@ -30,7 +45,11 @@ in {
|
||||||
# Push password-store changes to git daily
|
# Push password-store changes to git daily
|
||||||
systemd.user.services.password-store-push = {
|
systemd.user.services.password-store-push = {
|
||||||
description = "Push password-store changes to git";
|
description = "Push password-store changes to git";
|
||||||
path = [ pass-wayland git gitAndTools.pass-git-helper ];
|
path = [
|
||||||
|
pass-wayland
|
||||||
|
git
|
||||||
|
gitAndTools.pass-git-helper
|
||||||
|
];
|
||||||
script = "${pkgs.pass-wayland}/bin/pass git push";
|
script = "${pkgs.pass-wayland}/bin/pass git push";
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
startAt = "18:00:00";
|
startAt = "18:00:00";
|
||||||
|
@ -83,7 +102,14 @@ in {
|
||||||
systemd.user.services.goimapnotify-disroot = {
|
systemd.user.services.goimapnotify-disroot = {
|
||||||
description = "Sync disroot mail using IMAP IDLE";
|
description = "Sync disroot mail using IMAP IDLE";
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
path = [ goimapnotify pass-wayland isync-oauth2 mu procps emacs-vterm ];
|
path = [
|
||||||
|
goimapnotify
|
||||||
|
pass-wayland
|
||||||
|
isync-oauth2
|
||||||
|
mu
|
||||||
|
procps
|
||||||
|
emacs-vterm
|
||||||
|
];
|
||||||
script = ''
|
script = ''
|
||||||
${pkgs.goimapnotify}/bin/goimapnotify -conf /home/coolneng/.config/goimapnotify/disroot.conf
|
${pkgs.goimapnotify}/bin/goimapnotify -conf /home/coolneng/.config/goimapnotify/disroot.conf
|
||||||
'';
|
'';
|
||||||
|
@ -100,8 +126,16 @@ in {
|
||||||
systemd.user.services.periodic-mail-sync = {
|
systemd.user.services.periodic-mail-sync = {
|
||||||
description = "Run a mail sync operation periodically";
|
description = "Run a mail sync operation periodically";
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
path =
|
path = [
|
||||||
[ pass-wayland isync-oauth2 mu procps emacs-vterm python39 gnupg nix ];
|
pass-wayland
|
||||||
|
isync-oauth2
|
||||||
|
mu
|
||||||
|
procps
|
||||||
|
emacs-vterm
|
||||||
|
python39
|
||||||
|
gnupg
|
||||||
|
nix
|
||||||
|
];
|
||||||
script = ''
|
script = ''
|
||||||
/home/coolneng/.local/share/scripts/mail-sync -a
|
/home/coolneng/.local/share/scripts/mail-sync -a
|
||||||
'';
|
'';
|
||||||
|
@ -116,13 +150,20 @@ in {
|
||||||
script = "chmod 751 /home/coolneng";
|
script = "chmod 751 /home/coolneng";
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
after = [ "home-coolneng.mount" ];
|
after = [ "home-coolneng.mount" ];
|
||||||
before = [ "mopidy.service" "mopidy-scan.service" ];
|
before = [
|
||||||
|
"mopidy.service"
|
||||||
|
"mopidy-scan.service"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Push panacea changes to git daily
|
# Push panacea changes to git daily
|
||||||
systemd.user.services.panacea-push = {
|
systemd.user.services.panacea-push = {
|
||||||
description = "Push panacea changes to git";
|
description = "Push panacea changes to git";
|
||||||
path = [ pass-wayland git gitAndTools.pass-git-helper ];
|
path = [
|
||||||
|
pass-wayland
|
||||||
|
git
|
||||||
|
gitAndTools.pass-git-helper
|
||||||
|
];
|
||||||
script = "${pkgs.git}/bin/git -C /home/coolneng/Projects/panacea push";
|
script = "${pkgs.git}/bin/git -C /home/coolneng/Projects/panacea push";
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
startAt = "14:00:00";
|
startAt = "14:00:00";
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
# Enable power-profiles-daemon
|
# Enable power-profiles-daemon
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
# Enable CUPS
|
# Enable CUPS
|
||||||
services.printing = {
|
services.printing = {
|
||||||
enable = true;
|
enable = true;
|
||||||
drivers = with pkgs; [ brgenml1cupswrapper hplip ];
|
drivers = with pkgs; [
|
||||||
|
brgenml1cupswrapper
|
||||||
|
hplip
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable SANE
|
# Enable SANE
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
let
|
let
|
||||||
coolneng =
|
coolneng = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC57m1j/G6iQyi2EpU3nj3+df5Z4PL/XbiOmDcqA7ODg";
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC57m1j/G6iQyi2EpU3nj3+df5Z4PL/XbiOmDcqA7ODg";
|
in
|
||||||
in {
|
{
|
||||||
"wireguard.age".publicKeys = [ coolneng ];
|
"wireguard.age".publicKeys = [ coolneng ];
|
||||||
"syncthing.age".publicKeys = [ coolneng ];
|
"syncthing.age".publicKeys = [ coolneng ];
|
||||||
"samba-ugent.age".publicKeys = [ coolneng ];
|
"samba-ugent.age".publicKeys = [ coolneng ];
|
||||||
|
|
Loading…
Reference in New Issue