From 0359491756e19f18f30096ead9c18abd5c2049e9 Mon Sep 17 00:00:00 2001 From: "samual.shop@proton.me" Date: Thu, 16 May 2024 11:55:24 +0100 Subject: [PATCH] fixed wallpaper-changer --- .../swww-wallpaper-changer/default.nix | 2 +- home/users/sam/default.nix | 4 +- .../common/optional/fileserver-nfs-mount.nix | 20 ++++++--- hosts/fileserver/default.nix | 2 +- hosts/fileserver/hardware-configuration.nix | 31 +++++++++++++ hosts/media/default.nix | 32 +++++++++++++ hosts/nixdev/default.nix | 45 +------------------ 7 files changed, 83 insertions(+), 53 deletions(-) create mode 100644 hosts/fileserver/hardware-configuration.nix create mode 100644 hosts/media/default.nix diff --git a/home/common/optional/desktop/wallpaper-changer/swww-wallpaper-changer/default.nix b/home/common/optional/desktop/wallpaper-changer/swww-wallpaper-changer/default.nix index 071c946..3ca13d1 100644 --- a/home/common/optional/desktop/wallpaper-changer/swww-wallpaper-changer/default.nix +++ b/home/common/optional/desktop/wallpaper-changer/swww-wallpaper-changer/default.nix @@ -26,7 +26,7 @@ while true; do find "$wallpaper_dir" -type f -follow \( -iname \*.jpg -o -iname \*.png -o -iname \*.gif -o -iname \*.bmp \) | shuf | while read -r file; do ${pkgs.swww}/bin/swww img "$file" --transition-step 10 --transition-fps 60 - [ $? != 0 ] && echo "swww failed, reloading daemon" && exit 1 + [ $? != 0 ] && echo "swww failed, reloading daemon" && ${pkgs.swww}/bin/swww-daemon & sleep 600 done done diff --git a/home/users/sam/default.nix b/home/users/sam/default.nix index e71d4cf..f776b90 100644 --- a/home/users/sam/default.nix +++ b/home/users/sam/default.nix @@ -20,7 +20,7 @@ programs.zsh = { enable = true; enableCompletion = true; - enableAutosuggestions = true; + programs.zsh.autosuggestion.enable = true; syntaxHighlighting.enable = true; shellAliases = { @@ -58,7 +58,7 @@ gtk.iconTheme.name = "GruvboxPlus"; qt.enable = true; - #qt.platformTheme.name = "gtk"; + qt.platformTheme.name = "gtk"; qt.style.name = "adwaita-dark"; qt.style.package = pkgs.adwaita-qt; diff --git a/hosts/common/optional/fileserver-nfs-mount.nix b/hosts/common/optional/fileserver-nfs-mount.nix index 272d163..f31f7d7 100644 --- a/hosts/common/optional/fileserver-nfs-mount.nix +++ b/hosts/common/optional/fileserver-nfs-mount.nix @@ -1,17 +1,27 @@ {...}: { - fileSystems."/mnt" = { - device = "/dev/vdb"; + fileSystems."/exports" = { + device = "/dev/vdb1"; fsType = "ext4"; - options = [ ]; }; services.nfs.server = { enable = true; - + # fixed rpc.statd port; for firewall + lockdPort = 4001; + mountdPort = 4002; + statdPort = 4000; + extraNfsdConfig = ''''; exports = '' - /mnt/ *(ro,insecure,all_squash) + /exports *(rw,insecure,all_squash) ''; }; + # open nfs ports + networking.firewall = { + enable = true; + # for NFSv3; view with `rpcinfo -p` + allowedTCPPorts = [ 111 2049 4000 4001 4002 20048 ]; + allowedUDPPorts = [ 111 2049 4000 4001 4002 20048 ]; + }; } diff --git a/hosts/fileserver/default.nix b/hosts/fileserver/default.nix index 5129b19..ce0d9c9 100644 --- a/hosts/fileserver/default.nix +++ b/hosts/fileserver/default.nix @@ -36,7 +36,7 @@ hostName = "fileserver"; networkmanager.enable = true; enableIPv6 = false; - hosts = { "192.168.122.223" = [ "fileserver" ] }; + hosts = { "192.168.122.223" = [ "fileserver" ]; }; }; time.timeZone = "Europe/London"; diff --git a/hosts/fileserver/hardware-configuration.nix b/hosts/fileserver/hardware-configuration.nix new file mode 100644 index 0000000..be04803 --- /dev/null +++ b/hosts/fileserver/hardware-configuration.nix @@ -0,0 +1,31 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/9bed98b2-5ee2-4408-a9b1-6d40e9b68135"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # 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 + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/hosts/media/default.nix b/hosts/media/default.nix new file mode 100644 index 0000000..1369a5b --- /dev/null +++ b/hosts/media/default.nix @@ -0,0 +1,32 @@ +{ inputs, config, lib, pkgs, outputs,... }: + +{ + imports = + [ + # Import core options + ./hardware-configuration.nix + ../common/core + + # Import optional options + ../common/optional/pipewire.nix + ../common/optional/hyprland.nix + ../common/optional/displayManager/sddm.nix + ../common/optional/openssh + + # Create users for this host + ../common/users/sam + + ]; + + nixpkgs = { + overlays = [ + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + ]; + config = { + allowUnfree = true; + }; + }; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; diff --git a/hosts/nixdev/default.nix b/hosts/nixdev/default.nix index bbd601d..b0178e9 100644 --- a/hosts/nixdev/default.nix +++ b/hosts/nixdev/default.nix @@ -1,4 +1,4 @@ -{ inputs, config, lib, pkgs, outputs, configLib, ... }: +{ inputs, config, lib, pkgs, outputs,... }: { imports = @@ -40,8 +40,6 @@ enableIPv6 = false; }; - - time.timeZone = "Europe/London"; i18n.defaultLocale = "en_GB.UTF-8"; @@ -53,54 +51,13 @@ services.printing.enable = true; -# sound.enable = true; -# hardware.pulseaudio.enable = true; - services.libinput.enable = true; -# users.users.sam = { -# isNormalUser = true; -# extraGroups = [ "wheel" ]; -# }; - -# users.users.sam.shell = pkgs.zsh; - - environment.systemPackages = with pkgs; [ -# curl -# vim -# home-manager -# tmux -# waybar -# git -# mako -# libnotify -# wl-clipboard -# swww -# rofi-wayland -# networkmanagerapplet -# htop -# sddm-theme -# sddm -# sshfs-fuse -# wdisplays - #wallpaper_changer -# #(callPackage ../../nixos_modules/themes/sddm-sugar-candy.nix{}).sddm-sugar-candy-theme -# libsForQt5.qt5.qtgraphicaleffects #required for sugar candy -# #(import ../../nixos_modules/scripts/wallpaper_changer.nix { inherit pkgs; }) - ]; - programs.gnupg.agent = { enable = true; enableSSHSupport = true; }; -# programs.zsh.enable = true; - hardware = { - opengl.enable = true; - nvidia.modesetting.enable = true; - }; - - system.stateVersion = "23.11"; }