From 230a73932720b2f98f2ba57c313c5b2cf1f4201c Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Sun, 28 May 2023 02:00:10 +0200 Subject: [PATCH] Started working on guest@euporie --- flake.nix | 71 +++++++++++++----- home/euporie.nix | 20 +++++ home/features/README.md | 12 +++ home/{adrielus => }/features/cli/bat.nix | 0 home/{adrielus => }/features/cli/default.nix | 0 home/{adrielus => }/features/cli/direnv.nix | 0 home/{adrielus => }/features/cli/exa.nix | 0 .../features/cli/fish/config.fish | 0 .../features/cli/fish/default.nix | 0 home/{adrielus => }/features/cli/git.nix | 0 home/{adrielus => }/features/cli/ssh.nix | 0 home/{adrielus => }/features/cli/starship.nix | 0 .../features/cli/tmux/default.nix | 0 .../features/cli/tmux/tmux.conf | 0 .../common => features/desktop}/alacritty.nix | 0 .../common => features/desktop}/discord.nix | 0 .../desktop}/eww/default.nix | 0 .../desktop}/eww/template.yuck | 0 .../desktop}/eww/widgets/dashboard.yuck | 0 .../desktop}/eww/widgets/eww.yuck | 0 .../desktop}/firefox/default.nix | 0 .../desktop}/firefox/icons/asana.png | Bin .../desktop}/firefox/icons/clockodo.png | Bin .../desktop}/firefox/icons/desmos.png | Bin .../desktop}/firefox/icons/gitlab.png | Bin .../desktop}/firefox/icons/monkeytype.png | Bin .../desktop}/firefox/userContent.css | 0 .../desktop}/qbittorrent.nix | 0 .../common => features/desktop}/signal.nix | 0 .../desktop}/wakatime/default.nix | 0 .../desktop}/wakatime/wakatime_config.age | 0 .../desktop}/wezterm/default.nix | 0 .../desktop}/wezterm/wezterm.lua | 0 .../common => features/desktop}/zathura.nix | 0 .../{adrielus => }/features/games/default.nix | 0 home/{adrielus => }/features/games/lutris.nix | 0 home/{adrielus => }/features/games/steam.nix | 0 home/{adrielus => }/features/games/wine.nix | 0 .../features/neovim/default.nix | 0 .../wayland/default.nix} | 7 +- .../common => features/wayland}/dunst.nix | 0 .../wayland}/hyprland/default.nix | 2 +- .../wayland}/hyprland/hyprland.conf | 0 .../common => features/wayland}/wofi.nix | 0 .../desktop => features/xorg}/default.nix | 11 ++- .../desktop/common => features/xorg}/feh.nix | 0 .../xorg}/polybar/default.nix | 0 .../xorg}/polybar/polybar.ini | 0 .../xorg}/polybar/template.mustache | 0 .../common => features/xorg}/rofi/config.rasi | 0 .../common => features/xorg}/rofi/default.nix | 0 .../desktop => features/xorg}/xmonad.nix | 11 +-- home/{adrielus => }/global/default.nix | 17 ++++- home/{adrielus => }/tethys.nix | 19 ++--- hosts/nixos/common/global/openssh.nix | 20 +++-- hosts/nixos/common/optional/pipewire.nix | 24 +++--- hosts/nixos/common/users/adrielus.nix | 45 ++++++----- hosts/nixos/euoprie/default.nix | 34 --------- hosts/nixos/euporie/default.nix | 17 +++++ hosts/nixos/tethys/default.nix | 2 +- scripts/hm-activate.sh | 7 -- scripts/hm-rebuild.sh | 4 - 62 files changed, 188 insertions(+), 135 deletions(-) create mode 100644 home/euporie.nix create mode 100644 home/features/README.md rename home/{adrielus => }/features/cli/bat.nix (100%) rename home/{adrielus => }/features/cli/default.nix (100%) rename home/{adrielus => }/features/cli/direnv.nix (100%) rename home/{adrielus => }/features/cli/exa.nix (100%) rename home/{adrielus => }/features/cli/fish/config.fish (100%) rename home/{adrielus => }/features/cli/fish/default.nix (100%) rename home/{adrielus => }/features/cli/git.nix (100%) rename home/{adrielus => }/features/cli/ssh.nix (100%) rename home/{adrielus => }/features/cli/starship.nix (100%) rename home/{adrielus => }/features/cli/tmux/default.nix (100%) rename home/{adrielus => }/features/cli/tmux/tmux.conf (100%) rename home/{adrielus/features/desktop/common => features/desktop}/alacritty.nix (100%) rename home/{adrielus/features/desktop/common => features/desktop}/discord.nix (100%) rename home/{adrielus/features/desktop/common => features/desktop}/eww/default.nix (100%) rename home/{adrielus/features/desktop/common => features/desktop}/eww/template.yuck (100%) rename home/{adrielus/features/desktop/common => features/desktop}/eww/widgets/dashboard.yuck (100%) rename home/{adrielus/features/desktop/common => features/desktop}/eww/widgets/eww.yuck (100%) rename home/{adrielus/features/desktop/common => features/desktop}/firefox/default.nix (100%) rename home/{adrielus/features/desktop/common => features/desktop}/firefox/icons/asana.png (100%) rename home/{adrielus/features/desktop/common => features/desktop}/firefox/icons/clockodo.png (100%) rename home/{adrielus/features/desktop/common => features/desktop}/firefox/icons/desmos.png (100%) rename home/{adrielus/features/desktop/common => features/desktop}/firefox/icons/gitlab.png (100%) rename home/{adrielus/features/desktop/common => features/desktop}/firefox/icons/monkeytype.png (100%) rename home/{adrielus/features/desktop/common => features/desktop}/firefox/userContent.css (100%) rename home/{adrielus/features/desktop/common => features/desktop}/qbittorrent.nix (100%) rename home/{adrielus/features/desktop/common => features/desktop}/signal.nix (100%) rename home/{adrielus/features/desktop/common => features/desktop}/wakatime/default.nix (100%) rename home/{adrielus/features/desktop/common => features/desktop}/wakatime/wakatime_config.age (100%) rename home/{adrielus/features/desktop/common => features/desktop}/wezterm/default.nix (100%) rename home/{adrielus/features/desktop/common => features/desktop}/wezterm/wezterm.lua (100%) rename home/{adrielus/features/desktop/common => features/desktop}/zathura.nix (100%) rename home/{adrielus => }/features/games/default.nix (100%) rename home/{adrielus => }/features/games/lutris.nix (100%) rename home/{adrielus => }/features/games/steam.nix (100%) rename home/{adrielus => }/features/games/wine.nix (100%) rename home/{adrielus => }/features/neovim/default.nix (100%) rename home/{adrielus/features/desktop/common/wayland.nix => features/wayland/default.nix} (94%) rename home/{adrielus/features/desktop/common => features/wayland}/dunst.nix (100%) rename home/{adrielus/features/desktop => features/wayland}/hyprland/default.nix (86%) rename home/{adrielus/features/desktop => features/wayland}/hyprland/hyprland.conf (100%) rename home/{adrielus/features/desktop/common => features/wayland}/wofi.nix (100%) rename home/{adrielus/features/desktop => features/xorg}/default.nix (58%) rename home/{adrielus/features/desktop/common => features/xorg}/feh.nix (100%) rename home/{adrielus/features/desktop/common => features/xorg}/polybar/default.nix (100%) rename home/{adrielus/features/desktop/common => features/xorg}/polybar/polybar.ini (100%) rename home/{adrielus/features/desktop/common => features/xorg}/polybar/template.mustache (100%) rename home/{adrielus/features/desktop/common => features/xorg}/rofi/config.rasi (100%) rename home/{adrielus/features/desktop/common => features/xorg}/rofi/default.nix (100%) rename home/{adrielus/features/desktop => features/xorg}/xmonad.nix (53%) rename home/{adrielus => }/global/default.nix (86%) rename home/{adrielus => }/tethys.nix (77%) delete mode 100644 hosts/nixos/euoprie/default.nix create mode 100644 hosts/nixos/euporie/default.nix delete mode 100755 scripts/hm-activate.sh delete mode 100755 scripts/hm-rebuild.sh diff --git a/flake.nix b/flake.nix index d0c6f2e..59e5217 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,7 @@ { description = "Satellite"; + # {{{ Inputs inputs = { # Nixpkgs nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11"; @@ -61,9 +62,11 @@ hyprland-contrib.url = "github:hyprwm/contrib"; hyprland-contrib.inputs.nixpkgs.follows = "nixpkgs-unstable"; }; + # }}} outputs = { self, nixpkgs, home-manager, ... }@inputs: let + # {{{ Common helpers inherit (self) outputs; forAllSystems = nixpkgs.lib.genAttrs [ "aarch64-linux" @@ -75,17 +78,20 @@ specialArgs = system: { inherit inputs outputs; + # This is used so often it makes sense to have it as it's own thing upkgs = inputs.nixpkgs-unstable.legacyPackages.${system}; }; + # }}} in { + # {{{ Packages # Acessible through 'nix build', 'nix shell', etc packages = forAllSystems (system: let pkgs = nixpkgs.legacyPackages.${system}; in import ./pkgs { inherit pkgs; } ); - - # Devshell for bootstrapping + # }}} + # {{{ Bootstrapping and other pinned devshells # Acessible through 'nix develop' devShells = forAllSystems (system: @@ -96,7 +102,8 @@ devshells = import ./devshells args; in devshells // { inherit default; }); - + # }}} + # {{{ Overlays and modules # Custom packages and modifications, exported as overlays overlays = import ./overlays; @@ -105,41 +112,65 @@ # Reusable home-manager modules homeManagerModules = import ./modules/home-manager // import ./modules/common; - + # }}} + # {{{ Nixos # NixOS configuration entrypoint # Available through 'nixos-rebuild --flake .#... - nixosConfigurations = { - tethys = let system = "x86_64-linux"; in - nixpkgs.lib.nixosSystem { + nixosConfigurations = + let + nixos = { system, hostname }: nixpkgs.lib.nixosSystem { specialArgs = specialArgs system; modules = [ home-manager.nixosModules.home-manager { - home-manager.users.adrielus = import ./home/adrielus/tethys.nix; + home-manager.users.adrielus = import ./home/tethys.nix; home-manager.extraSpecialArgs = specialArgs system; home-manager.useUserPackages = true; stylix.homeManagerIntegration.followSystem = false; stylix.homeManagerIntegration.autoImport = false; } - ./hosts/nixos/tethys + ./hosts/nixos/${hostname} ]; }; - }; - + in + { + tethys = nixos { + system = "x86_64-linux"; + hostname = "tethys"; + }; + euporie = nixos { + system = "x86_64-linux"; + hostname = "euporie"; + }; + }; + # }}} + # {{{ Home manager # Standalone home-manager configuration entrypoint # Available through 'home-manager --flake .#... - homeConfigurations = { - "adrielus@tethys" = let system = "x86_64-linux"; in - home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.${system}; - extraSpecialArgs = specialArgs system; - modules = [ - ./home/adrielus/tethys.nix - ]; + homeConfigurations = + let + mkHomeConfig = { system, hostname }: + home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.${system}; + extraSpecialArgs = specialArgs system; + modules = [ + ./home/${hostname}.nix + ]; + }; + in + { + "adrielus@tethys" = mkHomeConfig { + system = "x86_64-linux"; + hostname = "tethys"; }; - }; + "guest@euporie" = mkHomeConfig { + system = "x86_64-linux"; + hostname = "euporie"; + }; + }; + # }}} }; # {{{ Caching and whatnot diff --git a/home/euporie.nix b/home/euporie.nix new file mode 100644 index 0000000..d6ad9e2 --- /dev/null +++ b/home/euporie.nix @@ -0,0 +1,20 @@ +{ + imports = [ + ./global + ./features/wayland/hyprland + ]; + + # Set up my custom imperanence wrapper + satellite.persistence = { + enable = true; + + # Actual data/media (eg: projects, images, videos, etc) + at.data.path = "/persist/data"; + + # App state I want to keep + at.state.path = "/persist/state"; + + # App state which I should be able to delete at any point + at.cache.path = "/persist/cache"; + }; +} diff --git a/home/features/README.md b/home/features/README.md new file mode 100644 index 0000000..9e728dc --- /dev/null +++ b/home/features/README.md @@ -0,0 +1,12 @@ +# Common home manager stuff + +## File structure + +| Directory | Description | +| -------------------- | --------------------------------------------- | +| [cli/](./cli) | Configuration for terminal stuff | +| [desktop](./desktop) | Desktop apps usable on both wayland and xorg | +| [xorg](./xorg) | Xorg only stuff | +| [wayland](./wayland) | Wayland only stuff | +| [neovim](./neovim) | Neovim (to be expanded in the future ) | +| [games](./games) | Similar to [desktop](./desktop) but for games | diff --git a/home/adrielus/features/cli/bat.nix b/home/features/cli/bat.nix similarity index 100% rename from home/adrielus/features/cli/bat.nix rename to home/features/cli/bat.nix diff --git a/home/adrielus/features/cli/default.nix b/home/features/cli/default.nix similarity index 100% rename from home/adrielus/features/cli/default.nix rename to home/features/cli/default.nix diff --git a/home/adrielus/features/cli/direnv.nix b/home/features/cli/direnv.nix similarity index 100% rename from home/adrielus/features/cli/direnv.nix rename to home/features/cli/direnv.nix diff --git a/home/adrielus/features/cli/exa.nix b/home/features/cli/exa.nix similarity index 100% rename from home/adrielus/features/cli/exa.nix rename to home/features/cli/exa.nix diff --git a/home/adrielus/features/cli/fish/config.fish b/home/features/cli/fish/config.fish similarity index 100% rename from home/adrielus/features/cli/fish/config.fish rename to home/features/cli/fish/config.fish diff --git a/home/adrielus/features/cli/fish/default.nix b/home/features/cli/fish/default.nix similarity index 100% rename from home/adrielus/features/cli/fish/default.nix rename to home/features/cli/fish/default.nix diff --git a/home/adrielus/features/cli/git.nix b/home/features/cli/git.nix similarity index 100% rename from home/adrielus/features/cli/git.nix rename to home/features/cli/git.nix diff --git a/home/adrielus/features/cli/ssh.nix b/home/features/cli/ssh.nix similarity index 100% rename from home/adrielus/features/cli/ssh.nix rename to home/features/cli/ssh.nix diff --git a/home/adrielus/features/cli/starship.nix b/home/features/cli/starship.nix similarity index 100% rename from home/adrielus/features/cli/starship.nix rename to home/features/cli/starship.nix diff --git a/home/adrielus/features/cli/tmux/default.nix b/home/features/cli/tmux/default.nix similarity index 100% rename from home/adrielus/features/cli/tmux/default.nix rename to home/features/cli/tmux/default.nix diff --git a/home/adrielus/features/cli/tmux/tmux.conf b/home/features/cli/tmux/tmux.conf similarity index 100% rename from home/adrielus/features/cli/tmux/tmux.conf rename to home/features/cli/tmux/tmux.conf diff --git a/home/adrielus/features/desktop/common/alacritty.nix b/home/features/desktop/alacritty.nix similarity index 100% rename from home/adrielus/features/desktop/common/alacritty.nix rename to home/features/desktop/alacritty.nix diff --git a/home/adrielus/features/desktop/common/discord.nix b/home/features/desktop/discord.nix similarity index 100% rename from home/adrielus/features/desktop/common/discord.nix rename to home/features/desktop/discord.nix diff --git a/home/adrielus/features/desktop/common/eww/default.nix b/home/features/desktop/eww/default.nix similarity index 100% rename from home/adrielus/features/desktop/common/eww/default.nix rename to home/features/desktop/eww/default.nix diff --git a/home/adrielus/features/desktop/common/eww/template.yuck b/home/features/desktop/eww/template.yuck similarity index 100% rename from home/adrielus/features/desktop/common/eww/template.yuck rename to home/features/desktop/eww/template.yuck diff --git a/home/adrielus/features/desktop/common/eww/widgets/dashboard.yuck b/home/features/desktop/eww/widgets/dashboard.yuck similarity index 100% rename from home/adrielus/features/desktop/common/eww/widgets/dashboard.yuck rename to home/features/desktop/eww/widgets/dashboard.yuck diff --git a/home/adrielus/features/desktop/common/eww/widgets/eww.yuck b/home/features/desktop/eww/widgets/eww.yuck similarity index 100% rename from home/adrielus/features/desktop/common/eww/widgets/eww.yuck rename to home/features/desktop/eww/widgets/eww.yuck diff --git a/home/adrielus/features/desktop/common/firefox/default.nix b/home/features/desktop/firefox/default.nix similarity index 100% rename from home/adrielus/features/desktop/common/firefox/default.nix rename to home/features/desktop/firefox/default.nix diff --git a/home/adrielus/features/desktop/common/firefox/icons/asana.png b/home/features/desktop/firefox/icons/asana.png similarity index 100% rename from home/adrielus/features/desktop/common/firefox/icons/asana.png rename to home/features/desktop/firefox/icons/asana.png diff --git a/home/adrielus/features/desktop/common/firefox/icons/clockodo.png b/home/features/desktop/firefox/icons/clockodo.png similarity index 100% rename from home/adrielus/features/desktop/common/firefox/icons/clockodo.png rename to home/features/desktop/firefox/icons/clockodo.png diff --git a/home/adrielus/features/desktop/common/firefox/icons/desmos.png b/home/features/desktop/firefox/icons/desmos.png similarity index 100% rename from home/adrielus/features/desktop/common/firefox/icons/desmos.png rename to home/features/desktop/firefox/icons/desmos.png diff --git a/home/adrielus/features/desktop/common/firefox/icons/gitlab.png b/home/features/desktop/firefox/icons/gitlab.png similarity index 100% rename from home/adrielus/features/desktop/common/firefox/icons/gitlab.png rename to home/features/desktop/firefox/icons/gitlab.png diff --git a/home/adrielus/features/desktop/common/firefox/icons/monkeytype.png b/home/features/desktop/firefox/icons/monkeytype.png similarity index 100% rename from home/adrielus/features/desktop/common/firefox/icons/monkeytype.png rename to home/features/desktop/firefox/icons/monkeytype.png diff --git a/home/adrielus/features/desktop/common/firefox/userContent.css b/home/features/desktop/firefox/userContent.css similarity index 100% rename from home/adrielus/features/desktop/common/firefox/userContent.css rename to home/features/desktop/firefox/userContent.css diff --git a/home/adrielus/features/desktop/common/qbittorrent.nix b/home/features/desktop/qbittorrent.nix similarity index 100% rename from home/adrielus/features/desktop/common/qbittorrent.nix rename to home/features/desktop/qbittorrent.nix diff --git a/home/adrielus/features/desktop/common/signal.nix b/home/features/desktop/signal.nix similarity index 100% rename from home/adrielus/features/desktop/common/signal.nix rename to home/features/desktop/signal.nix diff --git a/home/adrielus/features/desktop/common/wakatime/default.nix b/home/features/desktop/wakatime/default.nix similarity index 100% rename from home/adrielus/features/desktop/common/wakatime/default.nix rename to home/features/desktop/wakatime/default.nix diff --git a/home/adrielus/features/desktop/common/wakatime/wakatime_config.age b/home/features/desktop/wakatime/wakatime_config.age similarity index 100% rename from home/adrielus/features/desktop/common/wakatime/wakatime_config.age rename to home/features/desktop/wakatime/wakatime_config.age diff --git a/home/adrielus/features/desktop/common/wezterm/default.nix b/home/features/desktop/wezterm/default.nix similarity index 100% rename from home/adrielus/features/desktop/common/wezterm/default.nix rename to home/features/desktop/wezterm/default.nix diff --git a/home/adrielus/features/desktop/common/wezterm/wezterm.lua b/home/features/desktop/wezterm/wezterm.lua similarity index 100% rename from home/adrielus/features/desktop/common/wezterm/wezterm.lua rename to home/features/desktop/wezterm/wezterm.lua diff --git a/home/adrielus/features/desktop/common/zathura.nix b/home/features/desktop/zathura.nix similarity index 100% rename from home/adrielus/features/desktop/common/zathura.nix rename to home/features/desktop/zathura.nix diff --git a/home/adrielus/features/games/default.nix b/home/features/games/default.nix similarity index 100% rename from home/adrielus/features/games/default.nix rename to home/features/games/default.nix diff --git a/home/adrielus/features/games/lutris.nix b/home/features/games/lutris.nix similarity index 100% rename from home/adrielus/features/games/lutris.nix rename to home/features/games/lutris.nix diff --git a/home/adrielus/features/games/steam.nix b/home/features/games/steam.nix similarity index 100% rename from home/adrielus/features/games/steam.nix rename to home/features/games/steam.nix diff --git a/home/adrielus/features/games/wine.nix b/home/features/games/wine.nix similarity index 100% rename from home/adrielus/features/games/wine.nix rename to home/features/games/wine.nix diff --git a/home/adrielus/features/neovim/default.nix b/home/features/neovim/default.nix similarity index 100% rename from home/adrielus/features/neovim/default.nix rename to home/features/neovim/default.nix diff --git a/home/adrielus/features/desktop/common/wayland.nix b/home/features/wayland/default.nix similarity index 94% rename from home/adrielus/features/desktop/common/wayland.nix rename to home/features/wayland/default.nix index 59cd899..ba091cc 100644 --- a/home/adrielus/features/desktop/common/wayland.nix +++ b/home/features/wayland/default.nix @@ -1,6 +1,11 @@ # Common wayland stuff { lib, pkgs, upkgs, ... }: { - imports = [ ./wofi.nix ./dunst.nix ]; + + imports = [ + ./wofi.nix + ./dunst.nix + ../desktop/wezterm # Default hyprland terminal + ]; # Makes some stuff run on wayland (?) # Taken from [here](https://github.com/fufexan/dotfiles/blob/3b0075fa7a5d38de13c8c32140c4b020b6b32761/home/wayland/default.nix#L14) diff --git a/home/adrielus/features/desktop/common/dunst.nix b/home/features/wayland/dunst.nix similarity index 100% rename from home/adrielus/features/desktop/common/dunst.nix rename to home/features/wayland/dunst.nix diff --git a/home/adrielus/features/desktop/hyprland/default.nix b/home/features/wayland/hyprland/default.nix similarity index 86% rename from home/adrielus/features/desktop/hyprland/default.nix rename to home/features/wayland/hyprland/default.nix index a5bd9b2..68bbf6d 100644 --- a/home/adrielus/features/desktop/hyprland/default.nix +++ b/home/features/wayland/hyprland/default.nix @@ -1,5 +1,5 @@ { pkgs, inputs, ... }: { - imports = [ ../common/wayland.nix ]; + imports = [ ../default.nix ]; home.packages = [ inputs.hyprland-contrib.packages.${pkgs.system}.grimblast ]; diff --git a/home/adrielus/features/desktop/hyprland/hyprland.conf b/home/features/wayland/hyprland/hyprland.conf similarity index 100% rename from home/adrielus/features/desktop/hyprland/hyprland.conf rename to home/features/wayland/hyprland/hyprland.conf diff --git a/home/adrielus/features/desktop/common/wofi.nix b/home/features/wayland/wofi.nix similarity index 100% rename from home/adrielus/features/desktop/common/wofi.nix rename to home/features/wayland/wofi.nix diff --git a/home/adrielus/features/desktop/default.nix b/home/features/xorg/default.nix similarity index 58% rename from home/adrielus/features/desktop/default.nix rename to home/features/xorg/default.nix index 684e020..531c770 100644 --- a/home/adrielus/features/desktop/default.nix +++ b/home/features/xorg/default.nix @@ -1,16 +1,15 @@ { pkgs, ... }: { imports = [ - ./common/rofi - ./common/polybar - ./common/eww - ./common/feh.nix + ../desktop/eww + ./rofi + ./polybar + ./feh.nix ]; # Other packages I want to install: home.packages = with pkgs; [ xclip # Clipboard stuff spectacle # Take screenshots + vimclip # Vim anywhere! ]; - - stylix.targets.xresources.enable = true; } diff --git a/home/adrielus/features/desktop/common/feh.nix b/home/features/xorg/feh.nix similarity index 100% rename from home/adrielus/features/desktop/common/feh.nix rename to home/features/xorg/feh.nix diff --git a/home/adrielus/features/desktop/common/polybar/default.nix b/home/features/xorg/polybar/default.nix similarity index 100% rename from home/adrielus/features/desktop/common/polybar/default.nix rename to home/features/xorg/polybar/default.nix diff --git a/home/adrielus/features/desktop/common/polybar/polybar.ini b/home/features/xorg/polybar/polybar.ini similarity index 100% rename from home/adrielus/features/desktop/common/polybar/polybar.ini rename to home/features/xorg/polybar/polybar.ini diff --git a/home/adrielus/features/desktop/common/polybar/template.mustache b/home/features/xorg/polybar/template.mustache similarity index 100% rename from home/adrielus/features/desktop/common/polybar/template.mustache rename to home/features/xorg/polybar/template.mustache diff --git a/home/adrielus/features/desktop/common/rofi/config.rasi b/home/features/xorg/rofi/config.rasi similarity index 100% rename from home/adrielus/features/desktop/common/rofi/config.rasi rename to home/features/xorg/rofi/config.rasi diff --git a/home/adrielus/features/desktop/common/rofi/default.nix b/home/features/xorg/rofi/default.nix similarity index 100% rename from home/adrielus/features/desktop/common/rofi/default.nix rename to home/features/xorg/rofi/default.nix diff --git a/home/adrielus/features/desktop/xmonad.nix b/home/features/xorg/xmonad.nix similarity index 53% rename from home/adrielus/features/desktop/xmonad.nix rename to home/features/xorg/xmonad.nix index c070b56..84ca850 100644 --- a/home/adrielus/features/desktop/xmonad.nix +++ b/home/features/xorg/xmonad.nix @@ -1,16 +1,9 @@ { pkgs, ... }: { imports = [ - ./common/wezterm - ./common/alacritty.nix + ./default.nix + ../desktop/alacritty.nix # Default xmonad terminal ]; - # Other packages I want to install: - home.packages = with pkgs; [ - vimclip # Vim anywhere! - ]; - - stylix.targets.gtk.enable = true; - # Command required to get the xdg stuff to work. Suggested by @lily on discord. xsession.initExtra = "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd --all"; } diff --git a/home/adrielus/global/default.nix b/home/global/default.nix similarity index 86% rename from home/adrielus/global/default.nix rename to home/global/default.nix index e73447b..9d17b45 100644 --- a/home/adrielus/global/default.nix +++ b/home/global/default.nix @@ -1,6 +1,6 @@ { inputs, lib, pkgs, config, outputs, ... }: let - # Extra modules to import + # {{{ Imports imports = [ inputs.stylix.homeManagerModules.stylix inputs.homeage.homeManagerModules.homeage @@ -12,17 +12,19 @@ let ../features/neovim ../../../common ]; - - # Extra overlays to add + # }}} + # {{{ Overlays overlays = [ # inputs.neovim-nightly-overlay.overlay inputs.agenix.overlay ]; + # }}} in { # Import all modules defined in modules/home-manager imports = builtins.attrValues outputs.homeManagerModules ++ imports; + # {{{ Nixpkgs nixpkgs = { # Add all overlays defined in the overlays directory overlays = builtins.attrValues outputs.overlays ++ overlays; @@ -33,6 +35,7 @@ in allowUnfreePredicate = (_: true); }; }; + # }}} # Nicely reload system units when changing configs systemd.user.startServices = "sd-switch"; @@ -59,10 +62,16 @@ in # Set the xdg env vars xdg.enable = true; - # Create xdg user directories + # {{{ Create xdg user directories xdg.userDirs = { enable = lib.mkDefault true; createDirectories = lib.mkDefault true; extraConfig.XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots"; }; + # }}} + # {{{ Ad-hoc stylix targets + stylix.targets.gtk.enable = true; + # TODO: is this useful outside xorg? + stylix.targets.xresources.enable = true; + # }}} } diff --git a/home/adrielus/tethys.nix b/home/tethys.nix similarity index 77% rename from home/adrielus/tethys.nix rename to home/tethys.nix index ea15997..dd7f52b 100644 --- a/home/adrielus/tethys.nix +++ b/home/tethys.nix @@ -1,14 +1,15 @@ -{ inputs, outputs, lib, config, pkgs, ... }: { +{ pkgs, ... }: { imports = [ ./global - ./features/desktop/common/discord.nix - ./features/desktop/common/signal.nix - ./features/desktop/common/qbittorrent.nix - ./features/desktop/common/zathura.nix - ./features/desktop/common/firefox - ./features/desktop/xmonad.nix - ./features/desktop/hyprland - ./features/desktop + + ./features/desktop/discord.nix + ./features/desktop/signal.nix + ./features/desktop/qbittorrent.nix + ./features/desktop/zathura.nix + ./features/desktop/firefox + + ./features/xorg/xmonad.nix + ./features/wayland/hyprland ./features/games ]; diff --git a/hosts/nixos/common/global/openssh.nix b/hosts/nixos/common/global/openssh.nix index 23ecc10..575427b 100644 --- a/hosts/nixos/common/global/openssh.nix +++ b/hosts/nixos/common/global/openssh.nix @@ -44,11 +44,19 @@ in # Add each host in this repo to the knownHosts list programs.ssh = { - knownHosts = builtins.mapAttrs - (name: _: { - publicKeyFile = pubKey name; - extraHostNames = lib.optional (name == hostname) "localhost"; - }) - hosts; + knownHosts = lib.pipe hosts [ + # attrsetof host -> attrsetof { ... } + (builtins.mapAttrs + # string -> host -> { ... } + (name: _: { + publicKeyFile = pubKey name; + extraHostNames = lib.optional (name == hostname) "localhost"; + })) + + # attrsetof { ... } -> attrsetof { ... } + (lib.attrset.filterAttrs + # string -> { ... } -> bool + (_: { publicKeyFile, ... }: builtins.pathExists publicKeyFile)) + ]; }; } diff --git a/hosts/nixos/common/optional/pipewire.nix b/hosts/nixos/common/optional/pipewire.nix index e031a1c..75fda12 100644 --- a/hosts/nixos/common/optional/pipewire.nix +++ b/hosts/nixos/common/optional/pipewire.nix @@ -1,6 +1,7 @@ -{ +{ pkgs, ... }: { security.rtkit.enable = true; hardware.pulseaudio.enable = false; + services.pipewire = { enable = true; alsa.enable = true; @@ -10,14 +11,17 @@ }; # Volume controls - environment.shellAliases = { - # Relative - "v-up" = "pactl set-sink-volume @DEFAULT_SINK@ +5%"; - "v-down" = "pactl set-sink-volume @DEFAULT_SINK@ +5%"; + environment.shellAliases = + let pactl = "${pkgs.pulseaudio}/bin/pactl"; + in + { + # Relative + "v-up" = "${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; + "v-down" = "${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; - # Absolute - "v-min" = "pactl set-sink-volume @DEFAULT_SINK@ 0%"; - "v-mid" = "pactl set-sink-volume @DEFAULT_SINK@ 50%"; - "v-max" = "pactl set-sink-volume @DEFAULT_SINK@ 100%"; - }; + # Absolute + "v-min" = "${pactl} set-sink-volume @DEFAULT_SINK@ 0%"; + "v-mid" = "${pactl} set-sink-volume @DEFAULT_SINK@ 50%"; + "v-max" = "${pactl} set-sink-volume @DEFAULT_SINK@ 100%"; + }; } diff --git a/hosts/nixos/common/users/adrielus.nix b/hosts/nixos/common/users/adrielus.nix index d70df07..bdc921e 100644 --- a/hosts/nixos/common/users/adrielus.nix +++ b/hosts/nixos/common/users/adrielus.nix @@ -1,4 +1,4 @@ -{ pkgs, outputs, config, ... }: +{ pkgs, outputs, config, lib, ... }: let # Record containing all the hosts hosts = outputs.nixosConfigurations; @@ -16,37 +16,36 @@ in # Create an user named adrielus users.adrielus = { - # Make fish the default shell - shell = pkgs.fish; + # Adds me to some default groups, and creates the home dir + isNormalUser = true; # File containing my password, managed by agenix passwordFile = config.age.secrets.adrielusPassword.path; + # Set default shell + shell = pkgs.fish; + # Add user to the following groups extraGroups = [ - "wheel" # access to sudo - "network" # for wireless stuff - "networkmanager" # I assume this let's me access network stuff? - "lp" # Allows me to use printers - "docker" # Allows me to use docker (?) - "audio" # Allows me to use audio devices - "video" # Allows me to use a webcam - "uinput" # I think this let's me write to virtual devices - "input" # Does this let me use evdev (?) - - # TODO: find out why I added these here a long time ago - "sound" - "tty" + "wheel" # Access to sudo + "lp" # Printers + "audio" # Audio devices + "video" # Webcam and the like + "network" # for wireless stuff (???) ]; - # Adds me to some default groups, and creates the home dir - isNormalUser = true; - openssh.authorizedKeys.keyFiles = - builtins.attrValues # attrsetof path -> path[] - (builtins.mapAttrs # ... -> attrsetof host -> attrsetof path - (name: _: idKey name) # string -> host -> path - hosts); + lib.pipe hosts [ + # attrsetof host -> attrsetof path + (builtins.mapAttrs + (name: _: idKey name)) # string -> host -> path + + # attrsetof path -> path[] + builtins.attrValues + + # path[] -> path[] + (builtins.filter builtins.pathExists) + ]; }; }; } diff --git a/hosts/nixos/euoprie/default.nix b/hosts/nixos/euoprie/default.nix deleted file mode 100644 index f65d386..0000000 --- a/hosts/nixos/euoprie/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ inputs, outputs, lib, config, pkgs, ... }: { - imports = [ - ../common/global - ../common/users/adrielus.nix - - ../common/optional/pipewire.nix - ../common/optional/touchpad.nix - ../common/optional/xserver.nix - ../common/optional/lightdm.nix - ../common/optional/steam.nix - ../common/optional/slambda.nix - ../common/optional/xdg-portal.nix - ../common/optional/hyprland.nix - ../common/optional/xmonad - - ./hardware-configuration.nix - ./boot.nix - ]; - - # Set the name of this machine! - networking.hostName = "tethys"; - - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion - system.stateVersion = "22.11"; - - # {{{ A few ad-hoc hardware settings - hardware.opengl.enable = true; - hardware.opentabletdrivers.enable = true; - # }}} - # {{{ A few ad-hoc programs - programs.kdeconnect.enable = true; - programs.extra-container.enable = true; - # }}} -} diff --git a/hosts/nixos/euporie/default.nix b/hosts/nixos/euporie/default.nix new file mode 100644 index 0000000..02b3346 --- /dev/null +++ b/hosts/nixos/euporie/default.nix @@ -0,0 +1,17 @@ +{ + imports = [ + ../common/global + + ../common/optional/pipewire.nix + ../common/optional/touchpad.nix + ../common/optional/lightdm.nix + ../common/optional/xdg-portal.nix + ../common/optional/hyprland.nix + ]; + + # Set the name of this machine! + networking.hostName = "euporie"; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "22.11"; +} diff --git a/hosts/nixos/tethys/default.nix b/hosts/nixos/tethys/default.nix index f65d386..f7a9e1b 100644 --- a/hosts/nixos/tethys/default.nix +++ b/hosts/nixos/tethys/default.nix @@ -1,4 +1,4 @@ -{ inputs, outputs, lib, config, pkgs, ... }: { +{ imports = [ ../common/global ../common/users/adrielus.nix diff --git a/scripts/hm-activate.sh b/scripts/hm-activate.sh deleted file mode 100755 index 0847a4c..0000000 --- a/scripts/hm-activate.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/run/current-system/sw/bin/bash -if [ $# -eq 0 ] - then - ~/.local/share/hm-result/activate - else - ~/.local/share/hm-result/specialization/$1/activate -fi diff --git a/scripts/hm-rebuild.sh b/scripts/hm-rebuild.sh deleted file mode 100755 index 5e1a5a2..0000000 --- a/scripts/hm-rebuild.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/run/current-system/sw/bin/bash -home-manager build --flake .#$1 -rm -rf ~/.local/share/hm-result/$1 -mv result ~/.local/share/hm-result/$1