From d0073fbee45015bbdc95aba42c221a736f682618 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 17 Aug 2023 10:31:46 +0300 Subject: [PATCH] Integrated nixos-hardware, more ricing, and much more --- devshells/haskell.nix | 2 +- dotfiles/neovim/lazy-lock.json | 8 +- dotfiles/neovim/lua/my/plugins/lspconfig.lua | 10 ++- dotfiles/neovim/lua/my/plugins/telescope.lua | 1 - flake.lock | 84 ++++++++++++++++--- flake.nix | 9 ++ home/features/cli/git.nix | 2 + home/features/persistence.nix | 6 +- home/features/wayland/anyrun/anyrun.css | 0 home/features/wayland/anyrun/default.nix | 18 ++++ home/features/wayland/default.nix | 3 +- home/features/wayland/hyprland/hyprland.conf | 6 +- home/features/wayland/wofi.nix | 23 ----- home/features/wayland/wofi/default.nix | 13 +++ home/features/wayland/wofi/wofi.css | 56 +++++++++++++ home/global/default.nix | 1 + hosts/nixos/common/global/openssh.nix | 2 +- hosts/nixos/common/optional/xdg-portal.nix | 4 +- .../nixos/common/optional/xmonad/default.nix | 2 +- hosts/nixos/common/users/common.nix | 2 +- hosts/nixos/lapetus/default.nix | 12 +-- .../default.nix} | 9 +- .../lapetus/{ => filesystems}/partitions.nix | 0 hosts/nixos/lapetus/{ => filesystems}/zfs.nix | 0 hosts/nixos/lapetus/hardware/default.nix | 14 ++++ .../generated.nix} | 0 hosts/nixos/lapetus/{ => keys}/id_ed25519.pub | 0 .../{ => keys}/ssh_host_ed25519_key.pub | 0 .../lapetus/{ => keys}/ssh_host_rsa_key.pub | 0 hosts/nixos/tethys/default.nix | 2 +- hosts/nixos/tethys/hardware/default.nix | 10 +++ .../generated.nix} | 0 hosts/nixos/tethys/{ => keys}/id_ed25519.pub | 0 .../{ => keys}/ssh_host_ed25519_key.pub | 0 .../tethys/{ => keys}/ssh_host_rsa_key.pub | 0 overlays/default.nix | 28 +++---- secrets.nix | 8 +- 37 files changed, 248 insertions(+), 87 deletions(-) create mode 100644 home/features/wayland/anyrun/anyrun.css create mode 100644 home/features/wayland/anyrun/default.nix delete mode 100644 home/features/wayland/wofi.nix create mode 100644 home/features/wayland/wofi/default.nix create mode 100644 home/features/wayland/wofi/wofi.css rename hosts/nixos/lapetus/{filesystems.nix => filesystems/default.nix} (54%) rename hosts/nixos/lapetus/{ => filesystems}/partitions.nix (100%) rename hosts/nixos/lapetus/{ => filesystems}/zfs.nix (100%) create mode 100644 hosts/nixos/lapetus/hardware/default.nix rename hosts/nixos/lapetus/{hardware-configuration.nix => hardware/generated.nix} (100%) rename hosts/nixos/lapetus/{ => keys}/id_ed25519.pub (100%) rename hosts/nixos/lapetus/{ => keys}/ssh_host_ed25519_key.pub (100%) rename hosts/nixos/lapetus/{ => keys}/ssh_host_rsa_key.pub (100%) create mode 100644 hosts/nixos/tethys/hardware/default.nix rename hosts/nixos/tethys/{hardware-configuration.nix => hardware/generated.nix} (100%) rename hosts/nixos/tethys/{ => keys}/id_ed25519.pub (100%) rename hosts/nixos/tethys/{ => keys}/ssh_host_ed25519_key.pub (100%) rename hosts/nixos/tethys/{ => keys}/ssh_host_rsa_key.pub (100%) diff --git a/devshells/haskell.nix b/devshells/haskell.nix index 13a3b26..d282ced 100644 --- a/devshells/haskell.nix +++ b/devshells/haskell.nix @@ -1,6 +1,6 @@ # shell containing the tools i most commonly use for haskell work! { pkgs, ... }: pkgs.mkShell { - nativebuildinputs = with pkgs; [ ghc hpack stack cabal-install ]; + buildInputs = with pkgs; [ ghc hpack stack cabal-install ]; } diff --git a/dotfiles/neovim/lazy-lock.json b/dotfiles/neovim/lazy-lock.json index 87bffff..e58483a 100644 --- a/dotfiles/neovim/lazy-lock.json +++ b/dotfiles/neovim/lazy-lock.json @@ -1,5 +1,5 @@ { - "LuaSnip": { "branch": "master", "commit": "99a94cc35ec99bf06263d0346128e908a204575c" }, + "LuaSnip": { "branch": "master", "commit": "409535b8fc54c650eb845b0c35e0cc7f08810284" }, "abbreinder.nvim": { "branch": "main", "commit": "5b2b5ff08a9ada42238d733aeebc6d3d96314d77" }, "abbremand.nvim": { "branch": "main", "commit": "d633341f632b0b2666dfc6dfe6b9842ba1610a1d" }, "catppuccin": { "branch": "main", "commit": "490078b1593c6609e6a50ad5001e7902ea601824" }, @@ -38,7 +38,7 @@ "neoconf.nvim": { "branch": "main", "commit": "08f146d53e075055500dca35e93281faff95716b" }, "neodev.nvim": { "branch": "main", "commit": "9a5c0f0de5c15fba52d4fb83d425d3f4fa7abfa1" }, "neogit": { "branch": "master", "commit": "e4c428239928425829cb5247e430f26d25d5788e" }, - "neorg": { "branch": "main", "commit": "66e5a4e4ed7645590ac8388abdedb8f840b88f0d" }, + "neorg": { "branch": "main", "commit": "f296a22864bbac0d94ad00fa18cc8231dbeaa1e3" }, "neorg-telescope": { "branch": "main", "commit": "1310d4aaefd8149c9839bbe1d5610e94389e2f0e" }, "nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" }, "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, @@ -46,8 +46,8 @@ "nvim-cmp": { "branch": "main", "commit": "51f1e11a89ec701221877532ee1a23557d291dd5" }, "nvim-comment": { "branch": "main", "commit": "e9ac16ab056695cad6461173693069ec070d2b23" }, "nvim-lspconfig": { "branch": "master", "commit": "a981d4447b92c54a4d464eb1a76b799bc3f9a771" }, - "nvim-tree.lua": { "branch": "master", "commit": "0a54dcb76b02f3a4e2da370c7a3f6f2b7b43ef01" }, - "nvim-treesitter": { "branch": "master", "commit": "bc52938ddde0ff6b3d51ff215d2c66f2e39b7099" }, + "nvim-tree.lua": { "branch": "master", "commit": "18c7a3119839adc4599d838726deae662859c8b2" }, + "nvim-treesitter": { "branch": "master", "commit": "93ee00cd9daf8d2e3fbaa2a18b8b9adcb4471b16" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "9e519b6146512c8e2e702faf8ac48420f4f5deec" }, "nvim-web-devicons": { "branch": "master", "commit": "ab899311f8ae00a47eae8e0879506cead8eb1561" }, "nvim_context_vt": { "branch": "master", "commit": "f44f46ecad6e6983fd04dac84c5a5c03815d3427" }, diff --git a/dotfiles/neovim/lua/my/plugins/lspconfig.lua b/dotfiles/neovim/lua/my/plugins/lspconfig.lua index 64c121a..61a4c78 100644 --- a/dotfiles/neovim/lua/my/plugins/lspconfig.lua +++ b/dotfiles/neovim/lua/my/plugins/lspconfig.lua @@ -119,9 +119,11 @@ local servers = { -- }}} -- {{{ Haskell hls = { - haskell = { - -- set formatter - formattingProvider = "ormolu", + settings = { + haskell = { + -- set formatter + formattingProvider = "fourmolu", + }, }, }, -- }}} @@ -226,7 +228,7 @@ function lspconfig.config() require("lspconfig")[lsp].setup({ on_attach = details.on_attach, - settings = details.settings, -- Specific per-language settings + settings = details.settings, -- Specific per-language settings flags = { debounce_text_changes = 150, -- This will be the default in neovim 0.7+ }, diff --git a/dotfiles/neovim/lua/my/plugins/telescope.lua b/dotfiles/neovim/lua/my/plugins/telescope.lua index cba6c60..458ef51 100644 --- a/dotfiles/neovim/lua/my/plugins/telescope.lua +++ b/dotfiles/neovim/lua/my/plugins/telescope.lua @@ -9,7 +9,6 @@ local telescope = { "nvim-lua/plenary.nvim" }, version = "0.1.x", - pin = true, cond = env.vscode.not_active(), } diff --git a/flake.lock b/flake.lock index 619f863..22903ab 100644 --- a/flake.lock +++ b/flake.lock @@ -22,6 +22,27 @@ "type": "github" } }, + "anyrun": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1692117840, + "narHash": "sha256-BT2URpn3zzcKaOv9RqSASZzOrIMrQdvpIAeBJLz8CZo=", + "owner": "Kirottu", + "repo": "anyrun", + "rev": "d4b16a7c2b92332dba34af45956cf726e40ec400", + "type": "github" + }, + "original": { + "owner": "Kirottu", + "repo": "anyrun", + "type": "github" + } + }, "base16": { "inputs": { "fromYaml": "fromYaml" @@ -209,7 +230,7 @@ "flake-parts": { "inputs": { "nixpkgs-lib": [ - "neovim-nightly-overlay", + "anyrun", "nixpkgs" ] }, @@ -228,6 +249,27 @@ } }, "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1685662779, + "narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" }, @@ -244,7 +286,7 @@ "type": "indirect" } }, - "flake-parts_3": { + "flake-parts_4": { "inputs": { "nixpkgs-lib": [ "neovim-nightly-overlay", @@ -267,7 +309,7 @@ "type": "github" } }, - "flake-parts_4": { + "flake-parts_5": { "inputs": { "nixpkgs-lib": "nixpkgs-lib_2" }, @@ -285,7 +327,7 @@ "type": "github" } }, - "flake-parts_5": { + "flake-parts_6": { "inputs": { "nixpkgs-lib": [ "nixpkgs-wayland", @@ -430,7 +472,7 @@ }, "hercules-ci-agent": { "inputs": { - "flake-parts": "flake-parts_3", + "flake-parts": "flake-parts_4", "haskell-flake": "haskell-flake", "nixpkgs": "nixpkgs" }, @@ -449,7 +491,7 @@ }, "hercules-ci-effects": { "inputs": { - "flake-parts": "flake-parts_2", + "flake-parts": "flake-parts_3", "hercules-ci-agent": "hercules-ci-agent", "nixpkgs": [ "neovim-nightly-overlay", @@ -498,11 +540,11 @@ ] }, "locked": { - "lastModified": 1687871164, - "narHash": "sha256-bBFlPthuYX322xOlpJvkjUBz0C+MOBjZdDOOJJ+G2jU=", + "lastModified": 1692099905, + "narHash": "sha256-/pSusGhmIdSdAaywQRFA5dVbfdIzlWQTecM+E46+cJ0=", "owner": "nix-community", "repo": "home-manager", - "rev": "07c347bb50994691d7b0095f45ebd8838cf6bc38", + "rev": "2a6679aa9cc3872c29ba2a57fe1b71b3e3c5649f", "type": "github" }, "original": { @@ -662,7 +704,7 @@ "neovim-nightly-overlay": { "inputs": { "flake-compat": "flake-compat_2", - "flake-parts": "flake-parts", + "flake-parts": "flake-parts_2", "hercules-ci-effects": "hercules-ci-effects", "neovim-flake": "neovim-flake", "nixpkgs": [ @@ -685,7 +727,7 @@ }, "nix-eval-jobs": { "inputs": { - "flake-parts": "flake-parts_5", + "flake-parts": "flake-parts_6", "nixpkgs": "nixpkgs_4" }, "locked": { @@ -704,7 +746,7 @@ }, "nixd": { "inputs": { - "flake-parts": "flake-parts_4", + "flake-parts": "flake-parts_5", "nixpkgs": "nixpkgs_2" }, "locked": { @@ -741,6 +783,22 @@ "type": "github" } }, + "nixos-hardware": { + "locked": { + "lastModified": 1691871742, + "narHash": "sha256-6yDNjfbAMpwzWL4y75fxs6beXHRANfYX8BNSPjYehck=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "430a56dd16fe583a812b2df44dca002acab2f4f6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1680213900, @@ -913,6 +971,7 @@ "root": { "inputs": { "agenix": "agenix", + "anyrun": "anyrun", "catppuccin-base16": "catppuccin-base16", "deploy-rs": "deploy-rs", "disko": "disko", @@ -926,6 +985,7 @@ "neovim-nightly-overlay": "neovim-nightly-overlay", "nixd": "nixd", "nixinate": "nixinate", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_3", "nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-wayland": "nixpkgs-wayland", diff --git a/flake.nix b/flake.nix index 6269dbe..9f5563c 100644 --- a/flake.nix +++ b/flake.nix @@ -88,6 +88,13 @@ # Nixinate nixinate.url = "github:matthewcroughan/nixinate"; nixinate.inputs.nixpkgs.follows = "nixpkgs-unstable"; + + # Anyrun + anyrun.url = "github:Kirottu/anyrun"; + anyrun.inputs.nixpkgs.follows = "nixpkgs"; + + # Nixos hardware + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; }; # }}} @@ -248,11 +255,13 @@ extra-substituters = [ "https://nix-community.cachix.org" # I think I need this for neovim-nightly? "https://nixpkgs-wayland.cachix.org" + "https://anyrun.cachix.org" ]; extra-trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" + "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" ]; }; # }}} diff --git a/home/features/cli/git.nix b/home/features/cli/git.nix index 20f593f..d686db7 100644 --- a/home/features/cli/git.nix +++ b/home/features/cli/git.nix @@ -12,6 +12,8 @@ # Syncthing ".stfolder" ".stversions" + # Direnv + ".direnv" ]; extraConfig = { diff --git a/home/features/persistence.nix b/home/features/persistence.nix index 9fd2a7a..e0848f3 100644 --- a/home/features/persistence.nix +++ b/home/features/persistence.nix @@ -66,12 +66,8 @@ # }}} # {{{ Steam satellite.persistence.at.state.apps.Steam = { - files = [ - ".steam/registry.vdf" # It seems like auto-login does not work without this - ]; - directories = [ - ".factorio" # TODO: perhaps this should leave in it's own file? + ".factorio" # TODO: perhaps this should have it's own file? # A couple of games don't play well with bindfs { diff --git a/home/features/wayland/anyrun/anyrun.css b/home/features/wayland/anyrun/anyrun.css new file mode 100644 index 0000000..e69de29 diff --git a/home/features/wayland/anyrun/default.nix b/home/features/wayland/anyrun/default.nix new file mode 100644 index 0000000..09ae7a2 --- /dev/null +++ b/home/features/wayland/anyrun/default.nix @@ -0,0 +1,18 @@ +{ inputs, pkgs, ... }: { + programs.anyrun = { + enable = true; + config = { + plugins = with inputs.anyrun.packages.${pkgs.system}; [ + applications + dictionary + rink + stdin + symbols + websearch + ]; + + width.fraction = 0.5; + height.fraction = 0.6; + }; + }; +} diff --git a/home/features/wayland/default.nix b/home/features/wayland/default.nix index 2fd30b1..a629d5c 100644 --- a/home/features/wayland/default.nix +++ b/home/features/wayland/default.nix @@ -1,10 +1,11 @@ # Common wayland stuff { lib, pkgs, upkgs, ... }: { imports = [ - ./wofi.nix ./dunst.nix ./wlsunset.nix ./wlogout.nix + ./wofi + ./anyrun ../desktop/wezterm # Default hyprland terminal ../desktop/batsignal.nix ../desktop/eww diff --git a/home/features/wayland/hyprland/hyprland.conf b/home/features/wayland/hyprland/hyprland.conf index 7126a93..1165d7c 100644 --- a/home/features/wayland/hyprland/hyprland.conf +++ b/home/features/wayland/hyprland/hyprland.conf @@ -25,8 +25,10 @@ decoration { } } -# Blur eww widgets -blurls=gtk-layer-shell +# Blur extra surfaces +layerrule = blur,gtk-layer-shell +layerrule = blur,wofi +layerrule = ignorezero,wofi input { kb_layout = us diff --git a/home/features/wayland/wofi.nix b/home/features/wayland/wofi.nix deleted file mode 100644 index 1eebf12..0000000 --- a/home/features/wayland/wofi.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ pkgs, config, ... }: -let - base16-wofi = config.lib.stylix.colors { - templateRepo = pkgs.fetchFromSourcehut { - owner = "~knezi"; - repo = "base16-wofi"; - rev = "2182a5ad36d372e625b3d8e1a20ba7447e77ed22"; - sha256 = "0hzn9lgh7rzahmzzdsgxnz4f8vvcpx5diwsnc7gb29gj9nbb1a8f"; - }; - }; -in -{ - programs.wofi = { - enable = true; - settings = { - allow_markup = true; - allow_images = true; - }; - }; - - # xdg.configFile."wofi/style.css".source = base16-wofi; -} - diff --git a/home/features/wayland/wofi/default.nix b/home/features/wayland/wofi/default.nix new file mode 100644 index 0000000..129a205 --- /dev/null +++ b/home/features/wayland/wofi/default.nix @@ -0,0 +1,13 @@ +{ config, ... }: +{ + programs.wofi = { + enable = true; + settings = { + allow_markup = true; + allow_images = true; + }; + }; + + xdg.configFile."wofi/style.css".source = config.satellite.dev.path "home/features/wayland/wofi/wofi.css"; +} + diff --git a/home/features/wayland/wofi/wofi.css b/home/features/wayland/wofi/wofi.css new file mode 100644 index 0000000..2d6803d --- /dev/null +++ b/home/features/wayland/wofi/wofi.css @@ -0,0 +1,56 @@ +/* Styling guide: https://cloudninja.pw/docs/wofi.html */ +window { + background:none; +} + +#outer-box { + margin: 3px; + border-radius: 8px; + /* box-shadow: .5px .5px 1.5px 1.5px rgba(0, 0, 0, .5); */ + /* background-color: rgba(256, 256, 256, 0.6); */ +} + +#input { + margin: 1rem; + padding: 1rem; + font-size: 2em; + border-radius: 8px; + box-shadow: .5px .5px 1.5px 1.5px rgba(0, 0, 0, .5); + /* background: none; */ + background-color: rgba(256, 256, 256, 0.6); +} + +#scroll { + margin: 1rem; + border-radius: 8px; + box-shadow: .5px .5px 1.5px 1.5px rgba(0, 0, 0, .5); + /* background: none; */ + background-color: rgba(256, 256, 256, 0.6); +} + +#entry { + margin: 0.7rem; + margin-bottom: 0; + color: #4c4f69; + border-radius: 8px; +} + +#text { + margin: .5rem; + font-size: 1.5em; +} + +#img { + margin-left: .5rem; +} + +#entry:selected { + outline: none; + color: #4c4f69; + background: rgba(188, 192, 204, 0.2); + box-shadow: .5px .5px 1.5px 1.5px rgba(0, 0, 0, .5); +} + +#text:selected { + color: #4c4f69; +} diff --git a/home/global/default.nix b/home/global/default.nix index fc257f8..99a332a 100644 --- a/home/global/default.nix +++ b/home/global/default.nix @@ -8,6 +8,7 @@ let inputs.impermanence.nixosModules.home-manager.impermanence inputs.hyprland.homeManagerModules.default inputs.spicetify-nix.homeManagerModules.spicetify + inputs.anyrun.homeManagerModules.default ../features/cli ../features/persistence.nix diff --git a/hosts/nixos/common/global/openssh.nix b/hosts/nixos/common/global/openssh.nix index 6d9a9ff..2c5a604 100644 --- a/hosts/nixos/common/global/openssh.nix +++ b/hosts/nixos/common/global/openssh.nix @@ -9,7 +9,7 @@ let hostname = config.networking.hostName; # Function from hostname to relative path to public ssh key - pubKey = host: ../../${host}/ssh_host_ed25519_key.pub; + pubKey = host: ../../${host}/keys/ssh_host_ed25519_key.pub; in { services.openssh = { diff --git a/hosts/nixos/common/optional/xdg-portal.nix b/hosts/nixos/common/optional/xdg-portal.nix index e8005e1..2c00cca 100644 --- a/hosts/nixos/common/optional/xdg-portal.nix +++ b/hosts/nixos/common/optional/xdg-portal.nix @@ -6,7 +6,9 @@ extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; }; + environment.systemPackages = [ pkgs.xdg-utils ]; + # HACK: copied from @lily on discord. - systemd.user.services.xdg-desktop-portal.path = lib.mkAfter [ "/run/current-system/sw" ]; + # systemd.user.services.xdg-desktop-portal.path = lib.mkAfter [ "/run/current-system/sw" ]; # services.gnome.at-spi2-core.enable = true; } diff --git a/hosts/nixos/common/optional/xmonad/default.nix b/hosts/nixos/common/optional/xmonad/default.nix index d09b471..c175ef0 100644 --- a/hosts/nixos/common/optional/xmonad/default.nix +++ b/hosts/nixos/common/optional/xmonad/default.nix @@ -1,6 +1,6 @@ { config, ... }: { - import = [ ../touchpad.nix ]; + imports = [ ../touchpad.nix ]; services.xserver = { enable = true; diff --git a/hosts/nixos/common/users/common.nix b/hosts/nixos/common/users/common.nix index 238b000..3d3ba0c 100644 --- a/hosts/nixos/common/users/common.nix +++ b/hosts/nixos/common/users/common.nix @@ -5,7 +5,7 @@ hosts = outputs.nixosConfigurations; # Function from hostname to relative path to public ssh key - idKey = host: ../../${host}/id_ed25519.pub; + idKey = host: ../../${host}/keys/id_ed25519.pub; in lib.pipe hosts [ # attrsetof host -> attrsetof path diff --git a/hosts/nixos/lapetus/default.nix b/hosts/nixos/lapetus/default.nix index 2f08d91..566f015 100644 --- a/hosts/nixos/lapetus/default.nix +++ b/hosts/nixos/lapetus/default.nix @@ -5,13 +5,8 @@ ../common/optional/slambda.nix ./services/syncthing.nix - ./hardware-configuration.nix - ./filesystems.nix - ./zfs.nix - - (import ./partitions.nix { - disks = [ "/dev/sda" ]; - }) + ./filesystems + ./hardware ]; # Machine ids @@ -24,7 +19,4 @@ # Bootloader boot.loader.systemd-boot.enable = true; - - # Do not suspend on lid closing - services.logind.lidSwitch = "ignore"; } diff --git a/hosts/nixos/lapetus/filesystems.nix b/hosts/nixos/lapetus/filesystems/default.nix similarity index 54% rename from hosts/nixos/lapetus/filesystems.nix rename to hosts/nixos/lapetus/filesystems/default.nix index 1bece46..32247d7 100644 --- a/hosts/nixos/lapetus/filesystems.nix +++ b/hosts/nixos/lapetus/filesystems/default.nix @@ -1,6 +1,13 @@ -# Mark a bunch of paths as needed for boot { lib, ... }: { + imports = [ + ./zfs.nix + (import ./partitions.nix { + disks = [ "/dev/sda" ]; + }) + ]; + + # Mark a bunch of paths as needed for boot fileSystems = lib.attrsets.genAttrs [ "/" "/nix" "/persist/data" "/persist/state" "/persist/local/cache" "/boot" ] (_: { neededForBoot = true; }); diff --git a/hosts/nixos/lapetus/partitions.nix b/hosts/nixos/lapetus/filesystems/partitions.nix similarity index 100% rename from hosts/nixos/lapetus/partitions.nix rename to hosts/nixos/lapetus/filesystems/partitions.nix diff --git a/hosts/nixos/lapetus/zfs.nix b/hosts/nixos/lapetus/filesystems/zfs.nix similarity index 100% rename from hosts/nixos/lapetus/zfs.nix rename to hosts/nixos/lapetus/filesystems/zfs.nix diff --git a/hosts/nixos/lapetus/hardware/default.nix b/hosts/nixos/lapetus/hardware/default.nix new file mode 100644 index 0000000..c0a42e8 --- /dev/null +++ b/hosts/nixos/lapetus/hardware/default.nix @@ -0,0 +1,14 @@ +{ inputs, ... }: +{ + imports = with inputs.nixos-hardware.nixosModules; [ + common-cpu-intel + common-gpu-intel + common-pc-laptop + common-pc-laptop-hdd + common-pc-hdd + ./generated.nix + ]; + + # Do not suspend on lid closing + services.logind.lidSwitch = "ignore"; +} diff --git a/hosts/nixos/lapetus/hardware-configuration.nix b/hosts/nixos/lapetus/hardware/generated.nix similarity index 100% rename from hosts/nixos/lapetus/hardware-configuration.nix rename to hosts/nixos/lapetus/hardware/generated.nix diff --git a/hosts/nixos/lapetus/id_ed25519.pub b/hosts/nixos/lapetus/keys/id_ed25519.pub similarity index 100% rename from hosts/nixos/lapetus/id_ed25519.pub rename to hosts/nixos/lapetus/keys/id_ed25519.pub diff --git a/hosts/nixos/lapetus/ssh_host_ed25519_key.pub b/hosts/nixos/lapetus/keys/ssh_host_ed25519_key.pub similarity index 100% rename from hosts/nixos/lapetus/ssh_host_ed25519_key.pub rename to hosts/nixos/lapetus/keys/ssh_host_ed25519_key.pub diff --git a/hosts/nixos/lapetus/ssh_host_rsa_key.pub b/hosts/nixos/lapetus/keys/ssh_host_rsa_key.pub similarity index 100% rename from hosts/nixos/lapetus/ssh_host_rsa_key.pub rename to hosts/nixos/lapetus/keys/ssh_host_rsa_key.pub diff --git a/hosts/nixos/tethys/default.nix b/hosts/nixos/tethys/default.nix index b9ebab1..e3782ad 100644 --- a/hosts/nixos/tethys/default.nix +++ b/hosts/nixos/tethys/default.nix @@ -13,8 +13,8 @@ ../common/optional/hyprland.nix ../common/optional/quietboot.nix + ./hardware ./services/syncthing.nix - ./hardware-configuration.nix ./boot.nix ]; diff --git a/hosts/nixos/tethys/hardware/default.nix b/hosts/nixos/tethys/hardware/default.nix new file mode 100644 index 0000000..3b6f9bf --- /dev/null +++ b/hosts/nixos/tethys/hardware/default.nix @@ -0,0 +1,10 @@ +{ inputs, ... }: +{ + imports = with inputs.nixos-hardware.nixosModules; [ + common-cpu-intel + common-gpu-intel + common-pc-laptop + common-pc-ssd + ./generated.nix + ]; +} diff --git a/hosts/nixos/tethys/hardware-configuration.nix b/hosts/nixos/tethys/hardware/generated.nix similarity index 100% rename from hosts/nixos/tethys/hardware-configuration.nix rename to hosts/nixos/tethys/hardware/generated.nix diff --git a/hosts/nixos/tethys/id_ed25519.pub b/hosts/nixos/tethys/keys/id_ed25519.pub similarity index 100% rename from hosts/nixos/tethys/id_ed25519.pub rename to hosts/nixos/tethys/keys/id_ed25519.pub diff --git a/hosts/nixos/tethys/ssh_host_ed25519_key.pub b/hosts/nixos/tethys/keys/ssh_host_ed25519_key.pub similarity index 100% rename from hosts/nixos/tethys/ssh_host_ed25519_key.pub rename to hosts/nixos/tethys/keys/ssh_host_ed25519_key.pub diff --git a/hosts/nixos/tethys/ssh_host_rsa_key.pub b/hosts/nixos/tethys/keys/ssh_host_rsa_key.pub similarity index 100% rename from hosts/nixos/tethys/ssh_host_rsa_key.pub rename to hosts/nixos/tethys/keys/ssh_host_rsa_key.pub diff --git a/overlays/default.nix b/overlays/default.nix index dbd36fb..5e9b0ed 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -22,20 +22,20 @@ }); # }}} # {{{ Discord - discord = - let - enableWayland = drv: bin: drv.overrideAttrs ( - old: { - nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ final.makeWrapper ]; - postFixup = (old.postFixup or "") + '' - wrapProgram $out/bin/${bin} \ - --add-flags "--enable-features=UseOzonePlatform" \ - --add-flags "--ozone-platform=wayland" - ''; - } - ); - in - enableWayland prev.discord "discord"; + # discord = + # let + # enableWayland = drv: bin: drv.overrideAttrs ( + # old: { + # nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ final.makeWrapper ]; + # postFixup = (old.postFixup or "") + '' + # wrapProgram $out/bin/${bin} \ + # --add-flags "--enable-features=UseOzonePlatform" \ + # --add-flags "--ozone-platform=wayland" + # ''; + # } + # ); + # in + # enableWayland prev.discord "discord"; # }}} }; diff --git a/secrets.nix b/secrets.nix index 0e9361a..b662867 100644 --- a/secrets.nix +++ b/secrets.nix @@ -1,9 +1,9 @@ let - tethys = builtins.readFile ./hosts/nixos/tethys/ssh_host_ed25519_key.pub; - lapetus = builtins.readFile ./hosts/nixos/lapetus/ssh_host_ed25519_key.pub; + tethys = builtins.readFile ./hosts/nixos/tethys/keys/ssh_host_ed25519_key.pub; + lapetus = builtins.readFile ./hosts/nixos/lapetus/keys/ssh_host_ed25519_key.pub; - adrielus_tethys = builtins.readFile ./hosts/nixos/tethys/id_ed25519.pub; - adrielus_lapetus = builtins.readFile ./hosts/nixos/lapetus/id_ed25519.pub; + adrielus_tethys = builtins.readFile ./hosts/nixos/tethys/keys/id_ed25519.pub; + adrielus_lapetus = builtins.readFile ./hosts/nixos/lapetus/keys/id_ed25519.pub; all_hosts = [ tethys lapetus ]; in