aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2023-10-09 10:08:42 +0200
committerKarel Kočí <cynerd@email.cz>2023-10-09 10:08:42 +0200
commit6181236775ef1d77bce3c70b02b822a36f3137a8 (patch)
tree7deed60834d023a0159d1f2d7560f05f70097998 /nixos
parent582e5d9959733b2849e3750a41b6aa2547e949e0 (diff)
downloadnixos-personal-6181236775ef1d77bce3c70b02b822a36f3137a8.tar.gz
nixos-personal-6181236775ef1d77bce3c70b02b822a36f3137a8.tar.bz2
nixos-personal-6181236775ef1d77bce3c70b02b822a36f3137a8.zip
Update and tweak style
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/desktop.nix268
-rw-r--r--nixos/modules/develop.nix33
-rw-r--r--nixos/modules/home-assistant.nix4
-rw-r--r--nixos/routers/router.nix149
4 files changed, 224 insertions, 230 deletions
diff --git a/nixos/modules/desktop.nix b/nixos/modules/desktop.nix
index 093a9c2..3697ec8 100644
--- a/nixos/modules/desktop.nix
+++ b/nixos/modules/desktop.nix
@@ -23,139 +23,141 @@ in {
};
config = mkIf cnf.enable {
- programs.sway.enable = true;
- programs.sway.wrapperFeatures.gtk = true;
- programs.sway.extraPackages = with pkgs;
- [
- gnome.dconf-editor
- glib
- gsettings-desktop-schemas
- i3blocks
- sysstat
- wofi
- rofimoji
- wev
- swaybackground
- myswaylock
-
- alacritty
-
- kanshi
- wdisplays
- wayvnc
- wl-mirror
- slurp
- grim
- wf-recorder
- wl-clipboard
- wl-color-picker
- swayidle
- dunst
- libnotify
-
- isync
- msmtp
- notmuch
- astroid
- taskwarrior
- vdirsyncer
- khal
- khard
- gnupg
- pinentry-gnome
- pinentry-curses
- (pass.withExtensions (exts: [
- exts.pass-otp
- exts.pass-audit
- ]))
-
- chromium
- ferdium
- signal-desktop
- libreoffice
- mupdf
- zathura
- pdfgrep
-
- xdg-utils
- xdg-launch
- mesa-demos
- vulkan-tools
-
- pulsemixer
- mpd
- mpc-cli
- ncmpcpp
- feh
- shotwell
- id3lib
- vlc
- mpv
- youtube-dl
- spotify
-
- nordic
- delft-icon-theme
- gnome.adwaita-icon-theme
- vanilla-dmz
- sound-theme-freedesktop
- gucharmap
-
- (sdcv.withDictionaries [stardict-en-cz stardict-de-cz stardict-cz])
-
- samba
- cifs-utils
-
- tigervnc
- freerdp
- plasma5Packages.kdeconnect-kde
-
- hdparm
- ethtool
- multipath-tools
- usb-modeswitch
- v4l-utils
-
- # Calculating
- python3Packages.numpy
- python3Packages.sympy
- python3Packages.matplotlib
-
- # Creation
- simple-scan
- audacity
- gimp
- inkscape
- blender
- kdenlive
-
- # GStreamer
- gst_all_1.gst-libav
- gst_all_1.gst-plugins-bad
- gst_all_1.gst-plugins-base
- gst_all_1.gst-plugins-good
- gst_all_1.gst-plugins-ugly
- gst_all_1.gst-plugins-viperfx
-
- # Writing
- texlive.combined.scheme-full
- vale
-
- # Gnome utils
- gnome-firmware
- gaphor
-
- # CAD
- freecad
- kicad
- sweethome3d.application
- qelectrotech
- ]
- ++ (optionals cnf.laptop [
- # Power management
- powertop
- acpi
- ]);
+ programs.sway = {
+ enable = true;
+ wrapperFeatures.gtk = true;
+ extraPackages = with pkgs;
+ [
+ gnome.dconf-editor
+ glib
+ gsettings-desktop-schemas
+ i3blocks
+ sysstat
+ wofi
+ rofimoji
+ wev
+ swaybackground
+ myswaylock
+
+ alacritty
+
+ kanshi
+ wdisplays
+ wayvnc
+ wl-mirror
+ slurp
+ grim
+ wf-recorder
+ wl-clipboard
+ wl-color-picker
+ swayidle
+ dunst
+ libnotify
+
+ isync
+ msmtp
+ notmuch
+ astroid
+ taskwarrior
+ vdirsyncer
+ khal
+ khard
+ gnupg
+ pinentry-gnome
+ pinentry-curses
+ (pass.withExtensions (exts: [
+ exts.pass-otp
+ exts.pass-audit
+ ]))
+
+ chromium
+ ferdium
+ signal-desktop
+ libreoffice
+ mupdf
+ zathura
+ pdfgrep
+
+ xdg-utils
+ xdg-launch
+ mesa-demos
+ vulkan-tools
+
+ pulsemixer
+ mpd
+ mpc-cli
+ ncmpcpp
+ feh
+ shotwell
+ id3lib
+ vlc
+ mpv
+ youtube-dl
+ spotify
+
+ nordic
+ delft-icon-theme
+ gnome.adwaita-icon-theme
+ vanilla-dmz
+ sound-theme-freedesktop
+ gucharmap
+
+ (sdcv.withDictionaries [stardict-en-cz stardict-de-cz stardict-cz])
+
+ samba
+ cifs-utils
+
+ tigervnc
+ freerdp
+ plasma5Packages.kdeconnect-kde
+
+ hdparm
+ ethtool
+ multipath-tools
+ usb-modeswitch
+ v4l-utils
+
+ # Calculating
+ python3Packages.numpy
+ python3Packages.sympy
+ python3Packages.matplotlib
+
+ # Creation
+ simple-scan
+ audacity
+ gimp
+ inkscape
+ blender
+ kdenlive
+
+ # GStreamer
+ gst_all_1.gst-libav
+ gst_all_1.gst-plugins-bad
+ gst_all_1.gst-plugins-base
+ gst_all_1.gst-plugins-good
+ gst_all_1.gst-plugins-ugly
+ gst_all_1.gst-plugins-viperfx
+
+ # Writing
+ texlive.combined.scheme-full
+ vale
+
+ # Gnome utils
+ gnome-firmware
+ gaphor
+
+ # CAD
+ freecad
+ kicad
+ sweethome3d.application
+ qelectrotech
+ ]
+ ++ (optionals cnf.laptop [
+ # Power management
+ powertop
+ acpi
+ ]);
+ };
programs = {
vim.package = pkgs.vimHugeX;
firefox.enable = true;
diff --git a/nixos/modules/develop.nix b/nixos/modules/develop.nix
index 6cd7645..bd8d43d 100644
--- a/nixos/modules/develop.nix
+++ b/nixos/modules/develop.nix
@@ -77,14 +77,8 @@ with lib; {
geckodriver
chromedriver
- # Lua
- (lua5_1.withPackages (luapkgs:
- with luapkgs; [
- luacheck
- ]))
-
- # Ansible
- ansible
+ # Julia
+ julia
# Qemmu
qemu
@@ -96,7 +90,6 @@ with lib; {
tftp-hpa
# Network
- iperf2
iperf3
wireshark
inetutils
@@ -137,19 +130,17 @@ with lib; {
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0105", MODE:="0660", GROUP="develop", SYMLINK+="jlink_%n"
'';
- virtualisation.containers = {
- enable = true;
- };
- virtualisation.docker = {
- enable = true;
- autoPrune.enable = true;
- storageDriver = "btrfs";
- };
- virtualisation.lxd = {
- enable = true;
- recommendedSysctlSettings = true;
- };
virtualisation = {
+ containers.enable = true;
+ docker = {
+ enable = true;
+ autoPrune.enable = true;
+ storageDriver = "btrfs";
+ };
+ lxd = {
+ enable = true;
+ recommendedSysctlSettings = true;
+ };
lxc.enable = true;
libvirtd.enable = true;
spiceUSBRedirection.enable = true;
diff --git a/nixos/modules/home-assistant.nix b/nixos/modules/home-assistant.nix
index abe8c1a..0567785 100644
--- a/nixos/modules/home-assistant.nix
+++ b/nixos/modules/home-assistant.nix
@@ -48,7 +48,9 @@ in {
}
];
};
- networking.firewall.allowedTCPPorts = [1883];
+ networking.firewall.allowedTCPPorts = [
+ 1883 # Mosquitto
+ ];
services.bigclown = {
gateway = {
diff --git a/nixos/routers/router.nix b/nixos/routers/router.nix
index 0139c6f..50405dc 100644
--- a/nixos/routers/router.nix
+++ b/nixos/routers/router.nix
@@ -1,7 +1,6 @@
{
config,
lib,
- pkgs,
...
}:
with lib; let
@@ -89,89 +88,89 @@ in {
nameservers = ["1.1.1.1" "8.8.8.8"];
};
- services.kea = {
- dhcp4 = {
- enable = true;
- settings = {
- lease-database = {
- name = "/var/lib/kea/dhcp4.leases";
- persist = true;
- type = "memfile";
- };
- valid-lifetime = 4000;
- renew-timer = 1000;
- rebind-timer = 2000;
- interfaces-config = {
- interfaces = ["brlan" "brguest"];
- service-sockets-max-retries = -1;
+ services = {
+ kea = {
+ dhcp4 = {
+ enable = true;
+ settings = {
+ lease-database = {
+ name = "/var/lib/kea/dhcp4.leases";
+ persist = true;
+ type = "memfile";
+ };
+ valid-lifetime = 4000;
+ renew-timer = 1000;
+ rebind-timer = 2000;
+ interfaces-config = {
+ interfaces = ["brlan" "brguest"];
+ service-sockets-max-retries = -1;
+ };
+ option-data = [
+ {
+ name = "domain-name-servers";
+ data = "1.1.1.1, 8.8.8.8";
+ }
+ ];
+ subnet4 = [
+ {
+ interface = "brlan";
+ subnet = "${ipv4.prefix2ip cnf.lanIP cnf.lanPrefix}/${toString cnf.lanPrefix}";
+ pools = let
+ ip_start = ipv4.ipAdd cnf.lanIP cnf.lanPrefix cnf.dynIPStart;
+ ip_end = ipv4.ipAdd cnf.lanIP cnf.lanPrefix (cnf.dynIPStart + cnf.dynIPCount);
+ in [{pool = "${ip_start} - ${ip_end}";}];
+ option-data = [
+ {
+ name = "routers";
+ data = cnf.lanIP;
+ }
+ ];
+ reservations = [
+ {
+ duid = "e4:6f:13:f3:d5:be";
+ ip-address = ipv4.ipAdd cnf.lanIP cnf.lanPrefix 60;
+ }
+ ];
+ }
+ {
+ interface = "brguest";
+ subnet = "192.168.1.0/24";
+ pools = [{pool = "192.168.1.50 - 192.168.1.254";}];
+ "option-data" = [
+ {
+ name = "routers";
+ data = "192.168.1.1";
+ }
+ ];
+ }
+ ];
};
- option-data = [
- {
- name = "domain-name-servers";
- data = "1.1.1.1, 8.8.8.8";
- }
- ];
- subnet4 = [
- {
- interface = "brlan";
- subnet = "${ipv4.prefix2ip cnf.lanIP cnf.lanPrefix}/${toString cnf.lanPrefix}";
- pools = let
- ip_start = ipv4.ipAdd cnf.lanIP cnf.lanPrefix cnf.dynIPStart;
- ip_end = ipv4.ipAdd cnf.lanIP cnf.lanPrefix (cnf.dynIPStart + cnf.dynIPCount);
- in [{pool = "${ip_start} - ${ip_end}";}];
- option-data = [
- {
- name = "routers";
- data = cnf.lanIP;
- }
- ];
- reservations = [
- {
- duid = "e4:6f:13:f3:d5:be";
- ip-address = ipv4.ipAdd cnf.lanIP cnf.lanPrefix 60;
- }
- ];
- }
- {
- interface = "brguest";
- subnet = "192.168.1.0/24";
- pools = [{pool = "192.168.1.50 - 192.168.1.254";}];
- "option-data" = [
- {
- name = "routers";
- data = "192.168.1.1";
- }
- ];
- }
- ];
};
};
+ radvd = {
+ enable = true;
+ config = ''
+ interface brlan {
+ AdvSendAdvert on;
+ MinRtrAdvInterval 3;
+ MaxRtrAdvInterval 10;
+ prefix ::/64 {
+ AdvOnLink on;
+ AdvAutonomous on;
+ AdvRouterAddr on;
+ };
+ RDNSS 2001:4860:4860::8888 2001:4860:4860::8844 {
+ };
+ };
+ '';
+ };
+ kresd = {enable = false;};
};
systemd.services.kea-dhcp4-server.after = [
"sys-subsystem-net-devices-brlan.device"
"sys-subsystem-net-devices-brguest.device"
];
- services.radvd = {
- enable = true;
- config = ''
- interface brlan {
- AdvSendAdvert on;
- MinRtrAdvInterval 3;
- MaxRtrAdvInterval 10;
- prefix ::/64 {
- AdvOnLink on;
- AdvAutonomous on;
- AdvRouterAddr on;
- };
- RDNSS 2001:4860:4860::8888 2001:4860:4860::8844 {
- };
- };
- '';
- };
-
- services.kresd = {enable = false;};
-
networking.nftables.enable = true;
networking.firewall = {
filterForward = true;