From 38b08f4982c186bfa04e8ef4d843537728302027 Mon Sep 17 00:00:00 2001 From: Tasia Iso Date: Fri, 7 Jun 2024 18:06:59 +0200 Subject: [PATCH] lol --- common/services/autoupgrade.nix | 71 ++++++++++++++++----------------- hosts/stuff/configuration.nix | 6 +++ hosts/yaseen/configuration.nix | 32 +++++++++------ 3 files changed, 59 insertions(+), 50 deletions(-) diff --git a/common/services/autoupgrade.nix b/common/services/autoupgrade.nix index 106b5d6..61890dc 100644 --- a/common/services/autoupgrade.nix +++ b/common/services/autoupgrade.nix @@ -1,44 +1,41 @@ {pkgs, ...}: { - # systemd.timers."nix-auto-upgrade" = { - # wantedBy = ["timers.target"]; - # timerConfig = { - # OnCalendar = "weekly"; - # Persistent = true; - # Unit = "nix-auto-upgrade"; - # }; - # }; + systemd.timers."nix-auto-upgrade" = { + wantedBy = ["timers.target"]; + timerConfig = { + FixedRandomDelay = false; + RandomizedDelaySec = 0; + OnCalendar = "weekly"; + Persistent = true; + Unit = "nix-auto-upgrade"; + }; + }; - # systemd.services."nix-auto-upgrade" = { - # script = '' - # set -eu - # # alias git=${pkgs.git}/bin/git + systemd.services."nix-auto-upgrade" = { + unitConfig = { + After="network-online.target"; + Description="NixOS Upgrade"; + Wants="network-online.target"; + # X-StopOnRemoval=false; ? + }; + serviceConfig = { + Type = "oneshot"; + User = "root"; + WorkingDirectory = /etc/nixos/nixos-config; - # ${pkgs.git}/bin/git pull -v - # # ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake .#$(cat /etc/hostname) + # X-RestartIfChanged=false; ? + }; - # # ${pkgs.curl}/bin/curl \ - # # -H "Title: NixOS upgrade done" \ - # # -H "Priority: low" \ - # # -H "Tags: low" \ - # # -d "$(cat /etc/hostname ): upgrade script done" \ - # # ntfy.sh/tasiaiso_upgrades &> /dev/null # Please don't make me learn how to manage secrets - # ''; - # serviceConfig = { - # Type = "oneshot"; - # User = "root"; - # WorkingDirectory = /etc/nixos/nixos-config; - # }; - # }; + script = '' + set -eu - system.autoUpgrade = { - enable = true; - flake = "git+https://gitea.com/tasiaiso/nixos-config"; - flags = [ - # "--update-input" - # "nixpkgs" - "-L" # print build logs - ]; - dates = "weekly"; - # randomizedDelaySec = "45min"; + ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch -L --flake git+https://gitea.com/tasiaiso/nixos-config --upgrade + + ${pkgs.curl}/bin/curl \ + -H "Title: NixOS upgrade done" \ + -H "Priority: low" \ + -H "Tags: low" \ + -d "$(cat /etc/hostname): upgrade script done" \ + ntfy.sh/tasiaiso_upgrades &> /dev/null # Please don't make me learn how to manage secrets + ''; }; } diff --git a/hosts/stuff/configuration.nix b/hosts/stuff/configuration.nix index c005543..23493ac 100644 --- a/hosts/stuff/configuration.nix +++ b/hosts/stuff/configuration.nix @@ -39,8 +39,14 @@ in { configDir = lib.mkForce "/home/user/Sync/configuration"; }; + security.pam.services.kwallet = { + name = "kwallet"; + enableKwallet = true; + }; + environment.systemPackages = with pkgs; [ # Additional system packages here + zoxide ]; services.displayManager.autoLogin.user = "user"; diff --git a/hosts/yaseen/configuration.nix b/hosts/yaseen/configuration.nix index ea0a16b..0c82149 100644 --- a/hosts/yaseen/configuration.nix +++ b/hosts/yaseen/configuration.nix @@ -8,13 +8,16 @@ sshKeys = import ../../crypto/ssh-keys.nix; in { imports = [ + # Defaults ./hardware-configuration.nix ../../common/base.nix ../../common/full-install.nix + # Localization ../../common/locales/en.nix ../../common/locales/fr-keymap.nix + # Hardware ../../common/hardware/intel-cpu.nix ../../common/hardware/tpm2.nix ../../common/hardware/wireless.nix @@ -23,21 +26,26 @@ in { ../../common/hardware/ssd.nix ../../common/hardware/btrfs.nix + # Software components ../../common/components/de/sddm.nix ../../common/components/de/plasma6.nix # ../../common/components/de/hyprland.nix + # Programs ../../common/programs/steam.nix + # Services ../../common/services/auditd.nix ../../common/services/nix-gc.nix ../../common/services/adguardhome.nix ../../common/services/syncthing.nix ../../common/services/usbguard.nix - ../../common/services/autoupgrade.nix + # Home-manager ../../home/tasia/home.nix + + # Personal modules ../../modules/nixos/tildefriends.nix ]; @@ -48,28 +56,28 @@ in { ACTION=="add", SUBSYSTEM=="leds", DEVPATH=="*:kbd_backlight", TEST=="color", ATTR{color}="fc4f05" ''; + # Nvidia GPU + hardware.nvidia.prime = { + intelBusId = "PCI:1:0:0"; + nvidiaBusId = "PCI:0:2:0"; + }; + networking = { hostName = "yaseen"; firewall = { allowedTCPPorts = [ # 8080 # ? - 8008 # ssb - 12345 # tildefriends - 13378 # audiobookshelf + # 8008 # ssb + # 12345 # tildefriends + # 13378 # audiobookshelf ]; allowedUDPPorts = [ - 8080 # ? + # 8080 # ? ]; }; }; - # Nvidia GPU - hardware.nvidia.prime = { - intelBusId = "PCI:1:0:0"; - nvidiaBusId = "PCI:0:2:0"; - }; - users.users.tasia.openssh.authorizedKeys.keys = [ sshKeys.tasia.yaseen ]; @@ -91,8 +99,6 @@ in { osu-lazer-bin prismlauncher - # inputs.nixos-conf-editor.packages.${system}.nixos-conf-editor - # inputs.nix-software-center.packages.${system}.nix-software-center ]; # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion