From 59e360139f8fc2c0a06024cb6cd6d1b2366d6de3 Mon Sep 17 00:00:00 2001 From: xeovalyte Date: Thu, 5 Sep 2024 19:20:03 +0200 Subject: [PATCH 1/2] Lots of changes --- flake.lock | 12 ++++++------ flake.nix | 20 +++++++++++++------ hosts/laptop/default.nix | 3 +++ hosts/laptop/home.nix | 7 +++++-- modules/home/cli/develop.nix | 1 - modules/home/gui/common/firefox.nix | 4 ++-- modules/home/gui/hyprland/default.nix | 5 ++++- modules/home/gui/thunderbird.nix | 23 ++++++++++++++++++++++ modules/system/gui/hyprland.nix | 28 ++++++++++++++++++++------- modules/system/gui/plasma.nix | 4 ++-- modules/system/gui/sddm-theme.nix | 15 ++++++++++++++ 11 files changed, 95 insertions(+), 27 deletions(-) create mode 100644 modules/system/gui/sddm-theme.nix diff --git a/flake.lock b/flake.lock index 7242ccc..aee0626 100644 --- a/flake.lock +++ b/flake.lock @@ -58,11 +58,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1720954236, - "narHash": "sha256-1mEKHp4m9brvfQ0rjCca8P1WHpymK3TOr3v34ydv9bs=", + "lastModified": 1725001927, + "narHash": "sha256-eV+63gK0Mp7ygCR0Oy4yIYSNcum2VQwnZamHxYTNi+M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "53e81e790209e41f0c1efa9ff26ff2fd7ab35e27", + "rev": "6e99f2a27d600612004fbd2c3282d614bfee6421", "type": "github" }, "original": { @@ -88,11 +88,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1720957393, - "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=", + "lastModified": 1725103162, + "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "693bc46d169f5af9c992095736e82c3488bf7dbb", + "rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 06e5a11..a48e92c 100644 --- a/flake.nix +++ b/flake.nix @@ -25,6 +25,7 @@ }; in { + # Laptop Configuration nixosConfigurations = { xv-laptop = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; @@ -33,12 +34,18 @@ ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) ./hosts/laptop - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.extraSpecialArgs = { inherit inputs nix-colors; }; - home-manager.users.xeovalyte.imports = [ ./hosts/laptop/home.nix ]; - } + ]; + }; + }; + + homeConfigurations = { + "xeovalyte@xv-laptop" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = { inherit inputs nix-colors; }; + modules = [ + ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) + + ./hosts/laptop/home.nix ]; }; }; @@ -54,6 +61,7 @@ home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; + home-manager.backupFileExtension = "backup"; home-manager.extraSpecialArgs = { inherit inputs nix-colors; }; home-manager.users.xeovalyte.imports = [ ./hosts/desktop/home.nix ]; } diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index ab4b67c..f6eed21 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -8,6 +8,7 @@ ../../modules/system/gui/hyprland.nix ../../modules/system/gui/steam.nix ../../modules/system/gui/thunar.nix + # ../../modules/system/gui/plasma.nix # CLI ../../modules/system/cli/common.nix @@ -49,6 +50,8 @@ boot.kernelPackages = pkgs.linuxPackages_latest; + hardware.opentabletdriver.enable = true; + system.stateVersion = "24.05"; } diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 43f3b71..00e8eb5 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -15,6 +15,7 @@ ../../modules/home/cli/ssh.nix ]; + options = { host = lib.mkOption { type = with lib.types; str; @@ -32,7 +33,6 @@ host = "xv-laptop"; - home.packages = with pkgs; [ # Desktop Applications kdenlive @@ -48,7 +48,7 @@ # Office libreoffice - onlyoffice-bin + unstable.onlyoffice-bin # Image editing gimp @@ -59,6 +59,9 @@ unstable.drawio ]; + # Enable home-manager + programs.home-manager.enable = true; + home.stateVersion = "24.05"; }; diff --git a/modules/home/cli/develop.nix b/modules/home/cli/develop.nix index e640503..8b4b845 100644 --- a/modules/home/cli/develop.nix +++ b/modules/home/cli/develop.nix @@ -3,7 +3,6 @@ { home.packages = with pkgs; [ unstable.devenv - unstable.surrealist cloc ]; diff --git a/modules/home/gui/common/firefox.nix b/modules/home/gui/common/firefox.nix index 0c4f294..08cf548 100644 --- a/modules/home/gui/common/firefox.nix +++ b/modules/home/gui/common/firefox.nix @@ -105,8 +105,8 @@ url = "https://youtube.com"; } { - label = "Schoolportaal"; - url = "https://coenecoopcollege.sharepoint.com/"; + label = "My TU Delft"; + url = "https://my.tudelft.nl/"; } ]; "signon.rememberSignons" = false; diff --git a/modules/home/gui/hyprland/default.nix b/modules/home/gui/hyprland/default.nix index bf7f71f..5e4fec1 100644 --- a/modules/home/gui/hyprland/default.nix +++ b/modules/home/gui/hyprland/default.nix @@ -2,7 +2,6 @@ { imports = [ -# ./hyprpaper.nix ./waybar.nix ./fixes.nix ./dunst.nix @@ -19,6 +18,8 @@ nwg-bar powertop lxqt.lxqt-policykit + + networkmanagerapplet ]; wayland.windowManager.hyprland = { @@ -33,6 +34,8 @@ exec-once = [ "waybar" "lxqt-policykit-agent" + "nm-applet" + "blueman-applet" ]; "$mod" = "SUPER"; diff --git a/modules/home/gui/thunderbird.nix b/modules/home/gui/thunderbird.nix index f102e0b..e255bf5 100644 --- a/modules/home/gui/thunderbird.nix +++ b/modules/home/gui/thunderbird.nix @@ -35,6 +35,29 @@ thunderbird.enable = true; thunderbird.profiles = [ "default" ]; }; + # tudelft = { + # imap = { + # host = "outlook.office365.com"; + # port = 993; + # tls = { + # enable = true; + # }; + # }; + # smtp = { + # host = "smtp-a.tudelft.nl"; + # port = 465; + # tls = { + # enable = true; + # useStartTls = false; + # }; + # }; + # address = "tboomers@tudelft.nl"; + # realName = "Timo Boomers"; + # userName = "tboomers@tudelft.nl"; + # primary = false; + # thunderbird.enable = true; + # thunderbird.profiles = [ "default" ]; + # }; xeovalyte = { imap = { host = "mail.xeovalyte.dev"; diff --git a/modules/system/gui/hyprland.nix b/modules/system/gui/hyprland.nix index 22b059f..279e821 100644 --- a/modules/system/gui/hyprland.nix +++ b/modules/system/gui/hyprland.nix @@ -8,16 +8,29 @@ }; # Configure display manager - services.greetd = { + # services.greetd = { + # enable = true; + # settings = { + # default_session = { + # command = "${pkgs.greetd.tuigreet}/bin/tuigreet --remember --time --cmd Hyprland"; + # user = "xeovalyte"; + # }; + # }; + # }; + + # SDDM configuration + environment.systemPackages = with pkgs; [ + libsForQt5.qt5.qtquickcontrols2 + libsForQt5.qt5.qtgraphicaleffects + ]; + + services.displayManager.sddm = { enable = true; - settings = { - default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet --remember --time --cmd Hyprland"; - user = "xeovalyte"; - }; - }; + wayland.enable = true; + theme = "${import ./sddm-theme.nix { inherit pkgs; }}"; }; + # Sound configuration sound.enable = true; hardware.pulseaudio.enable = false; security.rtkit.enable = true; @@ -28,6 +41,7 @@ pulse.enable = true; }; + # Keyring configuration security.polkit.enable = true; services.gnome.gnome-keyring.enable = true; security.pam.services.greetd.enableGnomeKeyring = true; diff --git a/modules/system/gui/plasma.nix b/modules/system/gui/plasma.nix index bc1db29..7dfc6d7 100644 --- a/modules/system/gui/plasma.nix +++ b/modules/system/gui/plasma.nix @@ -1,9 +1,9 @@ { pkgs, ... }: { - services.xserver.enable = true; - services.displayManager.sddm.enable = true; + services.displayManager.sddm.wayland.enable = true; + services.desktopManager.plasma6.enable = true; hardware.pulseaudio.enable = false; diff --git a/modules/system/gui/sddm-theme.nix b/modules/system/gui/sddm-theme.nix new file mode 100644 index 0000000..0d91cf5 --- /dev/null +++ b/modules/system/gui/sddm-theme.nix @@ -0,0 +1,15 @@ +{ pkgs }: + +pkgs.stdenv.mkDerivation { + name = "sddm-theme"; + src = pkgs.fetchFromGitHub { + owner = "MarianArlt"; + repo = "sddm-sugar-dark"; + rev = "ceb2c455663429be03ba62d9f898c571650ef7fe"; + sha256 = "0153z1kylbhc9d12nxy9vpn0spxgrhgy36wy37pk6ysq7akaqlvy"; + }; + installPhase = '' + mkdir -p $out + cp -R ./* $out/ + ''; +} From 5655c8a056d725790ff88631d9bcc98875ef0333 Mon Sep 17 00:00:00 2001 From: xeovalyte Date: Thu, 12 Sep 2024 18:39:59 +0200 Subject: [PATCH 2/2] Bunch of config changes --- homelab/caddy/Caddyfile | 0 homelab/caddy/caddyfiles/Caddyfile | 0 homelab/caddy/docker-compose.yml | 19 +++++++++++++++++++ hosts/laptop/default.nix | 8 +++++++- modules/home/cli/common/shell.nix | 8 ++++++++ modules/home/gui/common/fonts.nix | 1 + modules/home/gui/hyprland/waybar.nix | 8 ++++---- modules/system/cli/common.nix | 5 +++++ modules/system/cli/docker.nix | 8 +++++++- 9 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 homelab/caddy/Caddyfile create mode 100644 homelab/caddy/caddyfiles/Caddyfile create mode 100644 homelab/caddy/docker-compose.yml diff --git a/homelab/caddy/Caddyfile b/homelab/caddy/Caddyfile new file mode 100644 index 0000000..e69de29 diff --git a/homelab/caddy/caddyfiles/Caddyfile b/homelab/caddy/caddyfiles/Caddyfile new file mode 100644 index 0000000..e69de29 diff --git a/homelab/caddy/docker-compose.yml b/homelab/caddy/docker-compose.yml new file mode 100644 index 0000000..4ca5248 --- /dev/null +++ b/homelab/caddy/docker-compose.yml @@ -0,0 +1,19 @@ +services: + caddy: + image: caddy:2.8 + container_name: caddy + restart: unless-stopped + cap_add: + - NET_ADMIN + ports: + - 80:80 + - 443:443 + - 443:443/udp + volumes: + - caddy_data:/data + - caddy_config:/config + - ./caddyfiles:/etc/caddy/ + +volumes: + caddy_data: + caddy_config: diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index f6eed21..b87da0f 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -38,6 +38,7 @@ enable = true; efiSupport = true; device = "nodev"; + configurationLimit = 32; }; networking.hostName = "xv-laptop"; # Define your hostname. @@ -50,7 +51,12 @@ boot.kernelPackages = pkgs.linuxPackages_latest; - hardware.opentabletdriver.enable = true; + # Configure wacom tablet + hardware.opentabletdriver = { + enable = true; + }; + + services.libinput.enable = true; system.stateVersion = "24.05"; diff --git a/modules/home/cli/common/shell.nix b/modules/home/cli/common/shell.nix index 19ca042..01a7aab 100644 --- a/modules/home/cli/common/shell.nix +++ b/modules/home/cli/common/shell.nix @@ -11,11 +11,19 @@ }; programs.bash = { + enable = false; + }; + + programs.zsh = { enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; }; programs.starship = { enable = true; enableBashIntegration = true; + enableZshIntegration = true; }; } diff --git a/modules/home/gui/common/fonts.nix b/modules/home/gui/common/fonts.nix index 97233c1..7fffede 100644 --- a/modules/home/gui/common/fonts.nix +++ b/modules/home/gui/common/fonts.nix @@ -7,6 +7,7 @@ noto-fonts fira-code font-awesome + dejavu_fonts (nerdfonts.override { fonts = [ "DejaVuSansMono" ]; }) ]; } diff --git a/modules/home/gui/hyprland/waybar.nix b/modules/home/gui/hyprland/waybar.nix index 9d0a6e4..a9c75b7 100644 --- a/modules/home/gui/hyprland/waybar.nix +++ b/modules/home/gui/hyprland/waybar.nix @@ -66,7 +66,7 @@ "warning" = 30; "critical" = 15; }; - "format" = "{icon} {capacity}%"; + "format" = "{icon} {capacity}%"; "format-icons" = [ "" "" "" "" "" ]; }; "pulseaudio" = { @@ -89,8 +89,8 @@ "network" = { "interface" = "wlan0"; "format" = "{ifname}"; - "format-wifi" = " {essid}"; - "format-ethernet" = "󰊗 {ipaddr}/{cidr}"; + "format-wifi" = " {essid}"; + "format-ethernet" = "󰊗 {ipaddr}/{cidr}"; "format-disconnected" = ""; "tooltip-format" = "{ifname} via {gwaddr}"; "tooltip-format-wifi" = "{essid} ({signalStrength}%)"; @@ -103,7 +103,7 @@ style = '' * { /* `otf-font-awesome` is required to be installed for icons */ - font-family: DejaVuSansM Nerd Font; + font-family: DejaVuSans, FontAwesome6Free; } #workspaces,#window,#clock,#battery,#tray,#pulseaudio,#network { diff --git a/modules/system/cli/common.nix b/modules/system/cli/common.nix index 710722b..fba7103 100644 --- a/modules/system/cli/common.nix +++ b/modules/system/cli/common.nix @@ -8,4 +8,9 @@ btop git ]; + + environment.pathsToLink = [ "/share/zsh" ]; + + programs.zsh.enable = true; + users.defaultUserShell = pkgs.zsh; } diff --git a/modules/system/cli/docker.nix b/modules/system/cli/docker.nix index b3f01b0..80d4841 100644 --- a/modules/system/cli/docker.nix +++ b/modules/system/cli/docker.nix @@ -1,7 +1,13 @@ { ... }: { - virtualisation.docker.enable = true; + virtualisation.docker = { + enable = true; + rootless = { + enable = true; + setSocketVariable = true; + }; + }; users.users.xeovalyte.extraGroups = [ "docker" ]; }