diff --git a/common/base.nix b/common/base.nix index 37c72c7..eb67e4f 100644 --- a/common/base.nix +++ b/common/base.nix @@ -7,6 +7,8 @@ ... }: { imports = [ + inputs.home-manager.nixosModules.home-manager + ./components/bootloader.nix ./components/networking.nix ./components/packages-base.nix @@ -55,7 +57,7 @@ outputs.overlays.unstable-packages ]; - # Unfree packages that can be installes regardless of the mchine's fre software policy + # Unfree packages that can be installes regardless of the machine's free software policy config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ # Steam diff --git a/common/programs/zsh.nix b/common/programs/zsh.nix index 586d6be..e963590 100644 --- a/common/programs/zsh.nix +++ b/common/programs/zsh.nix @@ -8,7 +8,7 @@ shellAliases = { ll = "ls -al"; done = "curl -d 'Done' ntfy.sh/tasiaiso_done"; - rebuild = "sudo nixos-rebuild switch -flake -I nixos-config=/home/tasia/nixos-config"; # .#hostname + rebuild = "sudo nixos-rebuild switch -flake -I nixos-config=/home/tasia/Desktop/nixos-config"; # .#hostname }; ohMyZsh = { diff --git a/common/tasia-packages.nix b/common/tasia-packages.nix deleted file mode 100644 index 11c6bad..0000000 --- a/common/tasia-packages.nix +++ /dev/null @@ -1,37 +0,0 @@ -{pkgs, ...}: { - environment.systemPackages = with pkgs; [ - bitwarden - # android-tools - gocryptfs - #endless-sky - #gnucash - # obs-studio - # kdenlive - rustc - cargo - nodejs - rpi-imager - # wireshark - # appimage-run - #ssb-patchwork - simplex-chat-desktop - #android-studio - #swig - picard - kleopatra - qbittorrent - tor-browser - protonvpn-gui - # radicle-cli - # opensnitch-ui - yarn - nodePackages.node-gyp - nodePackages.node-pre-gyp - # superTuxKart - openssl - - # qgis - - tildefriends - ]; -} diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc new file mode 100644 index 0000000..1327211 --- /dev/null +++ b/dotfiles/.bashrc @@ -0,0 +1,11 @@ +export XDG_DATA_HOME="$HOME/.local/share" + +if [[ -n $SSH_CONNECTION ]] ; then + curl \ + -H "Title: Test" \ + -H "Priority: high" \ + -H "Tags: warning" \ + -d "$(cat /etc/hostname ): ssh session ($SSH_CONNECTION)" \ + ntfy.sh/tasiaiso_alerts &> /dev/null +fi + diff --git a/dotfiles/.zshrc b/dotfiles/.zshrc new file mode 100644 index 0000000..8fadcde --- /dev/null +++ b/dotfiles/.zshrc @@ -0,0 +1,11 @@ +export XDG_DATA_HOME="$HOME/.local/share" + +if [[ -n $SSH_CONNECTION ]] ; then + curl \ + -H "Title: Test" \ + -H "Priority: high" \ + -H "Tags: warning" \ + -d "$(cat /etc/hostname ): ssh session" \ + ntfy.sh/tasiaiso_alerts &> /dev/null +fi + diff --git a/dotfiles/librewolf.overrides.cfg b/dotfiles/librewolf.overrides.cfg new file mode 100644 index 0000000..400a125 --- /dev/null +++ b/dotfiles/librewolf.overrides.cfg @@ -0,0 +1 @@ +defaultPref("identity.fxaccounts.enabled", true); diff --git a/flake.lock b/flake.lock index ea9bf60..ed3124e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,25 @@ { "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1713818326, + "narHash": "sha256-aw3xbVPJauLk/bbrlakIYxKpeuMWzA2feGrkIpIuXd8=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "67de98ae6eed5ad6f91b1142356d71a87ba97f21", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1713714899, @@ -18,6 +38,7 @@ }, "root": { "inputs": { + "home-manager": "home-manager", "nixpkgs": "nixpkgs", "stable": "stable", "unstable": "unstable" diff --git a/flake.nix b/flake.nix index 32bb51b..109918f 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,11 @@ stable.url = "github:nixos/nixpkgs/nixos-23.11"; unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { @@ -13,6 +18,7 @@ nixpkgs, stable, unstable, + home-manager, ... } @ inputs: let inherit (self) outputs; diff --git a/home/46d1/home.nix b/home/46d1/home.nix new file mode 100644 index 0000000..1903ffd --- /dev/null +++ b/home/46d1/home.nix @@ -0,0 +1,25 @@ +{pkgs, ...}: { + users.users.user = { + isNormalUser = true; + description = "User"; + extraGroups = ["networkmanager" "wheel" "syncthing" "tss"]; + initialPassword = "password123"; + }; + + home-manager.users.user = {pkgs, ...}: { + home.file = { + ".zshrc".source = ../../dotfiles/.zshrc; + ".bashrc".source = ../../dotfiles/.bashrc; + + # ".librewolf/librewolf.overrides.cfg".source = ../../dotfiles/librewolf.overrides.cfg; + }; + + home.packages = with pkgs; [ + # + ]; + + # The state version is required and should stay at the version you + # originally installed. + home.stateVersion = "24.05"; + }; +} diff --git a/home/tasia-but-old-username/home.nix b/home/tasia-but-old-username/home.nix new file mode 100644 index 0000000..4156f37 --- /dev/null +++ b/home/tasia-but-old-username/home.nix @@ -0,0 +1,60 @@ +{pkgs, ...}: { + users.users.user = { + isNormalUser = true; + description = "User"; + extraGroups = ["networkmanager" "wheel" "syncthing" "tss"]; + initialPassword = "password123"; + }; + + home-manager.users.user = {pkgs, ...}: { + home.file = { + ".zshrc".source = ../../dotfiles/.zshrc; + ".bashrc".source = ../../dotfiles/.bashrc; + + ".librewolf/librewolf.overrides.cfg".source = ../../dotfiles/librewolf.overrides.cfg; + }; + + home.packages = with pkgs; [ + bitwarden + # android-tools + gocryptfs + #endless-sky + #gnucash + # obs-studio + # kdenlive + rustc + cargo + nodejs + rpi-imager + # wireshark + # appimage-run + #ssb-patchwork + simplex-chat-desktop + #android-studio + #swig + picard + kleopatra + qbittorrent + tor-browser + protonvpn-gui + # radicle-cli + # opensnitch-ui + yarn + nodePackages.node-gyp + nodePackages.node-pre-gyp + # superTuxKart + openssl + home-manager + + # qgis + + atool + httpie + cowsay + ]; + + # The state version is required and should stay at the version you + # originally installed. + home.stateVersion = "24.05"; + }; +} diff --git a/home/tasia/home.nix b/home/tasia/home.nix new file mode 100644 index 0000000..767adbe --- /dev/null +++ b/home/tasia/home.nix @@ -0,0 +1,60 @@ +{pkgs, ...}: { + users.users.tasia = { + isNormalUser = true; + description = "User"; + extraGroups = ["networkmanager" "wheel" "syncthing" "tss"]; + initialPassword = "password123"; + }; + + home-manager.users.tasia = {pkgs, ...}: { + home.file = { + ".zshrc".source = ../../dotfiles/.zshrc; + ".bashrc".source = ../../dotfiles/.bashrc; + + ".librewolf/librewolf.overrides.cfg".source = ../../dotfiles/librewolf.overrides.cfg; + }; + + home.packages = with pkgs; [ + bitwarden + # android-tools + gocryptfs + #endless-sky + #gnucash + # obs-studio + # kdenlive + rustc + cargo + nodejs + rpi-imager + # wireshark + # appimage-run + #ssb-patchwork + simplex-chat-desktop + #android-studio + #swig + picard + kleopatra + qbittorrent + tor-browser + protonvpn-gui + # radicle-cli + # opensnitch-ui + yarn + nodePackages.node-gyp + nodePackages.node-pre-gyp + # superTuxKart + openssl + home-manager + + # qgis + + atool + httpie + cowsay + ]; + + # The state version is required and should stay at the version you + # originally installed. + home.stateVersion = "24.05"; + }; +} diff --git a/hosts/new-new-phoenix/configuration.nix b/hosts/new-new-phoenix/configuration.nix index 36b3b04..97c4c69 100644 --- a/hosts/new-new-phoenix/configuration.nix +++ b/hosts/new-new-phoenix/configuration.nix @@ -1,6 +1,7 @@ { pkgs, lib, + inputs, ... }: let sshKeys = import ../../crypto/ssh-keys.nix; @@ -9,7 +10,6 @@ in { ./hardware-configuration.nix ../../common/base.nix ../../common/full-install.nix - ../../common/tasia-packages.nix ../../common/locales/en.nix ../../common/locales/fr-keymap.nix @@ -24,7 +24,6 @@ in { ../../common/hardware/latest-kernel.nix ../../common/components/de/sddm.nix - # ../../common/components/de/greetd.nix ../../common/components/de/plasma6.nix ../../common/components/de/hyprland.nix @@ -34,6 +33,8 @@ in { ../../common/services/usbguard.nix ../../modules/nixos/vedirect-reader.nix + + ../../home/tasia/home.nix ]; boot.initrd.availableKernelModules = [ @@ -61,15 +62,9 @@ in { nvidiaBusId = "PCI:0:2:0"; }; - users.users.tasia = { - isNormalUser = true; - description = "User"; - extraGroups = ["networkmanager" "wheel" "syncthing" "tss"]; - initialPassword = "correcthorsebatterystaple"; - openssh.authorizedKeys.keys = [ - sshKeys.new-new-phoenix.tasia - ]; - }; + users.users.tasia.openssh.authorizedKeys.keys = [ + sshKeys.new-new-phoenix.tasia + ]; services.btrfs.autoScrub.fileSystems = ["/"]; @@ -88,7 +83,7 @@ in { boot.binfmt.emulatedSystems = ["aarch64-linux"]; environment.systemPackages = with pkgs; [ - # + tildefriends ]; services.blueman.enable = true; diff --git a/hosts/new-phoenix/configuration.nix b/hosts/new-phoenix/configuration.nix index 53b54b2..a2eb24e 100644 --- a/hosts/new-phoenix/configuration.nix +++ b/hosts/new-phoenix/configuration.nix @@ -18,6 +18,8 @@ in { ../../common/services/adguardhome.nix ../../common/services/syncthing.nix + + ../../home/tasia-but-old-username/home.nix ]; networking = { @@ -32,15 +34,9 @@ in { ]; }; - users.users.user = { - isNormalUser = true; - description = "User"; - extraGroups = ["networkmanager" "wheel" "syncthing"]; - initialPassword = "correcthorsebatterystaple"; - openssh.authorizedKeys.keys = [ - sshKeys.new-new-phoenix.tasia - ]; - }; + users.users.user.openssh.authorizedKeys.keys = [ + sshKeys.new-new-phoenix.tasia + ]; services.btrfs.autoScrub.fileSystems = lib.mkForce ["/" "/data"]; diff --git a/hosts/phoenix/configuration.nix b/hosts/phoenix/configuration.nix index 83106be..cdffaa6 100644 --- a/hosts/phoenix/configuration.nix +++ b/hosts/phoenix/configuration.nix @@ -9,7 +9,6 @@ in { ./hardware-configuration.nix ../../common/base.nix ../../common/full-install.nix - ../../common/tasia-packages.nix ../../common/locales/en.nix ../../common/locales/fr-keymap.nix @@ -27,6 +26,8 @@ in { ../../common/services/syncthing.nix ../../modules/nixos/vedirect-reader.nix + + ../../home/tasia-but-old-username/home.nix ]; networking = { @@ -45,15 +46,9 @@ in { }; }; - users.users.user = { - isNormalUser = true; - description = "User"; - extraGroups = ["networkmanager" "wheel" "syncthing"]; - initialPassword = "correcthorsebatterystaple"; - openssh.authorizedKeys.keys = [ - sshKeys.new-new-phoenix.tasia - ]; - }; + users.users.user.openssh.authorizedKeys.keys = [ + sshKeys.new-new-phoenix.tasia + ]; services.btrfs.autoScrub.fileSystems = lb.mkForce ["/" "/data"]; diff --git a/hosts/stuff/configuration.nix b/hosts/stuff/configuration.nix index 33848a3..bfcd21a 100644 --- a/hosts/stuff/configuration.nix +++ b/hosts/stuff/configuration.nix @@ -15,19 +15,15 @@ in { ../../common/de/plasma5.nix ../../common/services/syncthing.nix + + ../../home/46d1/home.nix ]; networking.hostName = "stuff"; - users.users.user = { - isNormalUser = true; - description = "User"; - extraGroups = ["networkmanager" "wheel" "syncthing"]; - initialPassword = "correcthorsebatterystaple"; - openssh.authorizedKeys.keys = [ - sshKeys.new-new-phoenix.tasia - ]; - }; + users.users.user.openssh.authorizedKeys.keys = [ + sshKeys.new-new-phoenix.tasia + ]; environment.systemPackages = with pkgs; [ # Additional system packages here diff --git a/hosts/theseus/configuration.nix b/hosts/theseus/configuration.nix index e7917c4..0e7bbba 100644 --- a/hosts/theseus/configuration.nix +++ b/hosts/theseus/configuration.nix @@ -26,21 +26,17 @@ in { ../../common/services/syncthing.nix ../../common/services/adguardhome.nix ../../common/programs/steam.nix + + ../../home/tasia-but-old-username/home.nix ]; networking = { hostName = "theseus"; }; - users.users.user = { - isNormalUser = true; - description = "User"; - extraGroups = ["networkmanager" "wheel" "syncthing"]; - initialPassword = "correcthorsebatterystaple"; - openssh.authorizedKeys.keys = [ - sshKeys.new-new-phoenix.tasia - ]; - }; + users.users.user.openssh.authorizedKeys.keys = [ + sshKeys.new-new-phoenix.tasia + ]; services.btrfs.autoScrub.fileSystems = lb.mkForce ["/" "/data"];