diff --git a/README.md b/README.md index 7bde5cb..08506ed 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,43 @@ -# Welcome to *the Satellite* +# Welcome to _the Satellite_ -In case you are not familiar with nix/nixos, this is a collection of configuration files which build my entire system in a declarative manner. The tool used to configure the global system is called [nixos](https://nixos.org/), and the one used to configure the individual users is called [home-manager](https://github.com/nix-community/home-manager). +In case you are not familiar with nix/nixos, this is a collection of configuration files which build my entire system in a declarative manner. The tool used to configure the global system is called [nixos](https://nixos.org/), and the one used to configure the individual users is called [home-manager](https://github.com/nix-community/home-manager). ### Features this repository includes: - Consistent base16 theming using [stylix](https://github.com/danth/stylix) -- [Agenix](https://github.com/ryantm/agenix) & [homeage](https://github.com/jordanisaacs/homeage) based secret management -- Sets up all the apps I use — including git, neovim, fish, tmux, starship, xmonad, rofi, polybar, discord, zathura, alacritty & more. +- [Agenix](https://github.com/ryantm/agenix) & [homeage](https://github.com/jordanisaacs/homeage) based secret management +- Sets up all the apps I use — including git, neovim, fish, tmux, starship, xmonad, rofi, polybar, discord, zathura, alacritty & more. ### In the future I might start using any of the other cool nix-based tools, like: - [nix-darwin](https://github.com/LnL7/nix-darwin) - like nixos but for macs - [disko](https://github.com/nix-community/disko) - format disks using nix -- [impernanence](https://github.com/nix-community/impermanence) - see the article about [erasing your darlings](https://grahamc.com/blog/erase-your-darlings) The current state of this repo is a refactor of my old, messy nixos config, based on the structure of [this template](https://github.com/Misterio77/nix-starter-configs). ### Hosts -This repo's structure is based on the concept of hosts - individual machines configured by me. I'm naming each host based on things in space/mythology (*they are the same picture*). The hosts I have right now are: +This repo's structure is based on the concept of hosts - individual machines configured by me. I'm naming each host based on things in space/mythology (_they are the same picture_). The hosts I have right now are: - [tethys](./hosts/nixos) - my personal laptop +### File structure + +| Location | Description | +| ---------------------------- | ------------------------------------------------------------------ | +| [common](./common) | Configuration loaded on both nixos and home-manager | +| [dotfiles](./dotfiles) | Contains some of the bigger dotfile dirs. Will eventually be moved | +| [hosts/nixos](./hosts/nixos) | Nixos configurations | +| [home](./home) | Home manager configurations | +| [pkgs](./pkgs) | Nix packages | +| [overlays](./overlays) | Nix overlays | +| [devshells](./devshells) | Nix shells | +| [stylua.toml](./stylua.toml) | Lua formatter config for the repo | +| [flake.nix](./flake.nix) | Nix flake entrypoint! | +| [shell.nix](./shell.nix) | Bootstrapping nix shell | +| [nixpkgs.nix](./nixpkgs.nix) | Pinned nixpkgs for bootstrapping | +| [secrets.nix](./secrets.nix) | Agenix entrypoint | + ### Points of interest Here's some things you might want to check out: @@ -33,22 +49,27 @@ Here's some things you might want to check out: > Well, this does not include links to every plugin I used for every program here, you can see more details in the respective configurations -- [nixos](http://nixos.org/) - nix based operating system -- [home-manager](https://github.com/nix-community/home-manager) - manage user configuration using nix -- [stylix](https://github.com/danth/stylix) - base16 module for nix - - [Base16 templates](https://github.com/chriskempson/base16-templates-source) - list of base16 theme templates - - [Catpuccin](https://github.com/catppuccin/catppuccin) - base16 theme I use - - [Rosepine](https://rosepinetheme.com/) - another theme I use +- [Nixos](http://nixos.org/) - nix based operating system +- [Home-manager](https://github.com/nix-community/home-manager) - manage user configuration using nix +- [Impernanence](https://github.com/nix-community/impermanence) - see the article about [erasing your darlings](https://grahamc.com/blog/erase-your-darlings) +- [Stylix](https://github.com/danth/stylix) - base16 module for nix + - [Base16 templates](https://github.com/chriskempson/base16-templates-source) - list of base16 theme templates + - [Catpuccin](https://github.com/catppuccin/catppuccin) - base16 theme I use + - [Rosepine](https://rosepinetheme.com/) - another theme I use - [Agenix](https://github.com/ryantm/agenix) & [homeage](https://github.com/jordanisaacs/homeage) - secret management -- [Xmonad](https://xmonad.org/) - window manager - - [Polybar](https://github.com/polybar/polybar) - desktop bar - - [Rofi](https://github.com/davatorium/rofi) - program launcher +- [Xmonad](https://xmonad.org/) - xorg window manager + - [Polybar](https://github.com/polybar/polybar) - desktop bar + - [Rofi](https://github.com/davatorium/rofi) - program launcher +- [Hyprland](https://hyprland.org/) - wayland compositor + - [Wlogout](https://github.com/ArtsyMacaw/wlogout) - wayland logout menu + - [Wofi](https://sr.ht/~scoopta/wofi/) - program launcher - [Neovim](https://neovim.io/) - my editor - [Neovide](https://neovide.dev/index.html) - neovim gui client - [Vimclip](https://github.com/hrantzsch/vimclip) - vim anywhere! - [Firenvim](https://github.com/glacambre/firenvim) - embed neovim in web browsers - [Tmux](https://github.com/tmux/tmux/wiki) - terminal multiplexer - [Alacritty](https://github.com/alacritty/alacritty) - terminal emulator +- [Wezterm](https://wezfurlong.org/wezterm/) - terminal emulator - [Fish](https://fishshell.com/) - user friendly shell - [Starship](https://starship.rs/) - shell prompt - [Zathura](https://pwmt.org/projects/zathura/) - pdf viewer diff --git a/common/themes/ai.nix b/common/themes/ai.nix deleted file mode 100644 index bcc5051..0000000 --- a/common/themes/ai.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - stylix = { - # image = ./wallpapers/eye.png; - image = ./wallpapers/colorful1.png; - # image = ./wallpapers/colorful2.png; - # image = ./wallpapers/colorful3.jpg; - - polarity = "light"; - }; -} diff --git a/common/themes/default.nix b/common/themes/default.nix index 699d329..a2ee3fd 100644 --- a/common/themes/default.nix +++ b/common/themes/default.nix @@ -2,7 +2,6 @@ # Select your current theme here! imports = [ ./rose-pine-dawn.nix - # ./ai.nix ]; # Requires me to manually turn targets on! diff --git a/common/themes/wallpapers/colorful1.png b/common/themes/wallpapers/colorful1.png deleted file mode 100644 index 57c508f..0000000 Binary files a/common/themes/wallpapers/colorful1.png and /dev/null differ diff --git a/common/themes/wallpapers/colorful2.png b/common/themes/wallpapers/colorful2.png deleted file mode 100644 index 1c5556b..0000000 Binary files a/common/themes/wallpapers/colorful2.png and /dev/null differ diff --git a/common/themes/wallpapers/colorful3.jpg b/common/themes/wallpapers/colorful3.jpg deleted file mode 100644 index 5f2712b..0000000 Binary files a/common/themes/wallpapers/colorful3.jpg and /dev/null differ diff --git a/flake.nix b/flake.nix index 59e5217..f87cd36 100644 --- a/flake.nix +++ b/flake.nix @@ -118,13 +118,13 @@ # Available through 'nixos-rebuild --flake .#... nixosConfigurations = let - nixos = { system, hostname }: nixpkgs.lib.nixosSystem { + nixos = { system, hostname, user }: nixpkgs.lib.nixosSystem { specialArgs = specialArgs system; modules = [ home-manager.nixosModules.home-manager { - home-manager.users.adrielus = import ./home/tethys.nix; + home-manager.users.${user} = import ./home/${hostname}.nix; home-manager.extraSpecialArgs = specialArgs system; home-manager.useUserPackages = true; stylix.homeManagerIntegration.followSystem = false; @@ -139,10 +139,13 @@ tethys = nixos { system = "x86_64-linux"; hostname = "tethys"; + user = "adrielus"; }; + euporie = nixos { system = "x86_64-linux"; hostname = "euporie"; + user = "guest"; }; }; # }}} diff --git a/home/features/cli/fish/config.fish b/home/features/cli/fish/config.fish index 4eb72a8..fe380c8 100644 --- a/home/features/cli/fish/config.fish +++ b/home/features/cli/fish/config.fish @@ -2,6 +2,7 @@ if status is-interactive and not set -q TMUX and not set -q NO_TMUX +and set -q ALWAYS_TMUX exec tmux attach -t Welcome || tmux || echo "Something went wrong trying to start tmux" end # }}} diff --git a/home/features/desktop/alacritty.nix b/home/features/desktop/alacritty.nix index 2387070..43cbe0c 100644 --- a/home/features/desktop/alacritty.nix +++ b/home/features/desktop/alacritty.nix @@ -12,7 +12,11 @@ y = 4; }; - env = { TERM = "tmux-256color"; }; + env = { + TERM = "tmux-256color"; + ALWAYS_TMUX = 1; + }; + working_directory = "${config.home.homeDirectory}/Projects/"; }; }; diff --git a/home/features/desktop/eww/default.nix b/home/features/desktop/eww/default.nix index 6052a77..39f01e6 100644 --- a/home/features/desktop/eww/default.nix +++ b/home/features/desktop/eww/default.nix @@ -4,7 +4,7 @@ let template = builtins.readFile ./template.yuck; }; - widgets = config.satellite.dev.path "home/adrielus/features/desktop/common/eww/widgets"; + widgets = config.satellite.dev.path "home/features/desktop/eww/widgets"; in { home.packages = [ pkgs.eww ]; diff --git a/home/features/desktop/wezterm/default.nix b/home/features/desktop/wezterm/default.nix index 34748b7..f17edf6 100644 --- a/home/features/desktop/wezterm/default.nix +++ b/home/features/desktop/wezterm/default.nix @@ -4,5 +4,5 @@ # Create link to config xdg.configFile."wezterm/colorscheme.lua".text = config.satellite.colorscheme.lua; xdg.configFile."wezterm/wezterm.lua".source = - config.satellite.dev.path "home/adrielus/features/desktop/common/wezterm/wezterm.lua"; + config.satellite.dev.path "home/features/desktop/wezterm/wezterm.lua"; } diff --git a/home/global/default.nix b/home/global/default.nix index 9d17b45..df596a6 100644 --- a/home/global/default.nix +++ b/home/global/default.nix @@ -10,7 +10,7 @@ let ../features/cli ../features/neovim - ../../../common + ../../common ]; # }}} # {{{ Overlays diff --git a/hosts/nixos/common/global/default.nix b/hosts/nixos/common/global/default.nix index 0f1a3c7..33698d2 100644 --- a/hosts/nixos/common/global/default.nix +++ b/hosts/nixos/common/global/default.nix @@ -35,5 +35,4 @@ in allowUnfree = true; }; }; - } diff --git a/hosts/nixos/common/global/openssh.nix b/hosts/nixos/common/global/openssh.nix index 575427b..ea4fc56 100644 --- a/hosts/nixos/common/global/openssh.nix +++ b/hosts/nixos/common/global/openssh.nix @@ -54,7 +54,7 @@ in })) # attrsetof { ... } -> attrsetof { ... } - (lib.attrset.filterAttrs + (lib.attrsets.filterAttrs # string -> { ... } -> bool (_: { publicKeyFile, ... }: builtins.pathExists publicKeyFile)) ]; diff --git a/hosts/nixos/common/optional/lightdm.nix b/hosts/nixos/common/optional/lightdm.nix index b9a7d53..1dd7977 100644 --- a/hosts/nixos/common/optional/lightdm.nix +++ b/hosts/nixos/common/optional/lightdm.nix @@ -2,6 +2,7 @@ let greeter = "enso"; in { + services.xserver.enable = true; services.xserver.displayManager.lightdm = { enable = true; @@ -17,6 +18,9 @@ in }; }; + # Set default display manager + services.xserver.displayManager.defaultSession = lib.mkDefault "hyprland"; + stylix.targets.lightdm.enable = true; } diff --git a/hosts/nixos/common/optional/xmonad/default.nix b/hosts/nixos/common/optional/xmonad/default.nix index ed02de5..e123e7c 100644 --- a/hosts/nixos/common/optional/xmonad/default.nix +++ b/hosts/nixos/common/optional/xmonad/default.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: { services.xserver = { enable = true; @@ -15,14 +15,6 @@ # Proper wallpaper zooming desktopManager.wallpaper.mode = "fill"; - - # Make xmonad session the default - displayManager.defaultSession = "none+xmonad"; - }; - - # Enable ad-hoc stylix targets: - stylix.targets = { - gtk.enable = true; }; } diff --git a/hosts/nixos/common/users/adrielus.nix b/hosts/nixos/common/users/adrielus.nix index bdc921e..29c2f6a 100644 --- a/hosts/nixos/common/users/adrielus.nix +++ b/hosts/nixos/common/users/adrielus.nix @@ -1,11 +1,4 @@ { pkgs, outputs, config, lib, ... }: -let - # Record containing all the hosts - hosts = outputs.nixosConfigurations; - - # Function from hostname to relative path to public ssh key - idKey = host: ../../${host}/id_ed25519.pub; -in { # Password file stored through agenix age.secrets.adrielusPassword.file = ./adrielus_password.age; @@ -35,17 +28,7 @@ in ]; openssh.authorizedKeys.keyFiles = - 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) - ]; + (import ./common.nix).authorizedKeys { inherit outputs lib; }; }; }; } diff --git a/hosts/nixos/common/users/common.nix b/hosts/nixos/common/users/common.nix new file mode 100644 index 0000000..238b000 --- /dev/null +++ b/hosts/nixos/common/users/common.nix @@ -0,0 +1,21 @@ +{ + authorizedKeys = { outputs, lib }: + let + # Record containing all the hosts + hosts = outputs.nixosConfigurations; + + # Function from hostname to relative path to public ssh key + idKey = host: ../../${host}/id_ed25519.pub; + in + 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/common/users/guest.nix b/hosts/nixos/common/users/guest.nix new file mode 100644 index 0000000..5a716d7 --- /dev/null +++ b/hosts/nixos/common/users/guest.nix @@ -0,0 +1,13 @@ +# For more comments check out [adrielus](./adrielus.nix) +{ pkgs, outputs, lib, ... }: +{ + users.mutableUsers = false; + users.users.guest = { + isNormalUser = true; + shell = pkgs.fish; + extraGroups = [ "wheel" "audio" "video" "network" "tty" ]; + password = "heyo"; + openssh.authorizedKeys.keyFiles = + (import ./common.nix).authorizedKeys { inherit outputs lib; }; + }; +} diff --git a/hosts/nixos/euporie/default.nix b/hosts/nixos/euporie/default.nix index 02b3346..ade46d4 100644 --- a/hosts/nixos/euporie/default.nix +++ b/hosts/nixos/euporie/default.nix @@ -1,6 +1,7 @@ -{ +{ lib, ... }: { imports = [ ../common/global + ../common/users/guest.nix ../common/optional/pipewire.nix ../common/optional/touchpad.nix @@ -9,6 +10,9 @@ ../common/optional/hyprland.nix ]; + # Usually included in the hardware-configuration + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + # Set the name of this machine! networking.hostName = "euporie"; diff --git a/hosts/nixos/tethys/default.nix b/hosts/nixos/tethys/default.nix index f7a9e1b..e77e616 100644 --- a/hosts/nixos/tethys/default.nix +++ b/hosts/nixos/tethys/default.nix @@ -25,10 +25,14 @@ # {{{ A few ad-hoc hardware settings hardware.opengl.enable = true; - hardware.opentabletdrivers.enable = true; + hardware.opentabletdriver.enable = true; # }}} # {{{ A few ad-hoc programs programs.kdeconnect.enable = true; programs.extra-container.enable = true; # }}} + # {{{ Ad-hoc stylix targets + # TODO: include this on all gui hosts + stylix.targets.gtk.enable = true; + # }}} } diff --git a/modules/home-manager/firefox/default.nix b/modules/home-manager/firefox/default.nix index 9f04202..af360e3 100644 --- a/modules/home-manager/firefox/default.nix +++ b/modules/home-manager/firefox/default.nix @@ -11,6 +11,8 @@ in }; app = lib.mkOption { + default = { }; + description = "Attr set of firefox web apps to install as desktop apps"; type = lib.types.attrsOf (lib.types.submodule ({ name, ... }: { options = { @@ -50,8 +52,6 @@ in }; }; })); - - description = "Attr set of firefox web apps to install as desktop apps"; }; }; diff --git a/secrets.nix b/secrets.nix index 1834749..01479b1 100644 --- a/secrets.nix +++ b/secrets.nix @@ -8,5 +8,5 @@ in "./hosts/nixos/common/users/adrielus_password.age".publicKeys = [ adrielus tethys ]; # Scoped for the user - "./home/adrielus/features/desktop/common/wakatime/wakatime_config.age".publicKeys = [ adrielus ]; + "./home/features/desktop/wakatime/wakatime_config.age".publicKeys = [ adrielus ]; }