From 64f31f3080c574441ae63184dde1a53a41cc1299 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Tue, 23 Jan 2024 19:13:42 -0600 Subject: [PATCH] many things --- flake.lock | 36 +++++++++------------------ flake.nix | 18 +++----------- hosts/algiz/default.nix | 2 +- hosts/othalan/default.nix | 2 +- lib/default.nix | 4 +-- modules/cli.nix | 42 +++++++++++++++---------------- modules/fonts.nix | 4 +-- modules/hyprland.nix | 52 ++++++++++++++++++--------------------- modules/langs/misc.nix | 22 +++++++++-------- modules/langs/nim.nix | 38 +++++++++++++++------------- modules/langs/node.nix | 21 +++++++++------- modules/langs/python.nix | 41 +++++++++++++++--------------- modules/langs/tex.nix | 19 ++++++++------ modules/nix.nix | 20 ++++++++++++--- modules/qtile.nix | 1 - modules/vpn.nix | 8 ++++-- 16 files changed, 166 insertions(+), 164 deletions(-) diff --git a/flake.lock b/flake.lock index 6ea8b9f..a4a3234 100644 --- a/flake.lock +++ b/flake.lock @@ -18,7 +18,6 @@ "flake-parts": { "inputs": { "nixpkgs-lib": [ - "nixpkgs-wayland", "nix-eval-jobs", "nixpkgs" ] @@ -239,7 +238,9 @@ "inputs": { "flake-parts": "flake-parts", "nix-github-actions": "nix-github-actions", - "nixpkgs": "nixpkgs_2", + "nixpkgs": [ + "nixpkgs" + ], "treefmt-nix": "treefmt-nix" }, "locked": { @@ -259,7 +260,6 @@ "nix-github-actions": { "inputs": { "nixpkgs": [ - "nixpkgs-wayland", "nix-eval-jobs", "nixpkgs" ] @@ -280,16 +280,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1705856552, - "narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=", + "lastModified": 1705883077, + "narHash": "sha256-ByzHHX3KxpU1+V0erFy8jpujTufimh6KaS/Iv3AciHk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d", + "rev": "5f5210aa20e343b7e35f40c033000db0ef80d7b9", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -313,7 +313,9 @@ "inputs": { "flake-compat": "flake-compat", "lib-aggregate": "lib-aggregate", - "nix-eval-jobs": "nix-eval-jobs", + "nix-eval-jobs": [ + "nix-eval-jobs" + ], "nixpkgs": [ "nixpkgs" ] @@ -332,26 +334,11 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1703134684, - "narHash": "sha256-SQmng1EnBFLzS7WSRyPM9HgmZP2kLJcPAz+Ug/nug6o=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "d6863cbcbbb80e71cecfc03356db1cda38919523", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "root": { "inputs": { "hyprland": "hyprland", "hyprland-contrib": "hyprland-contrib", + "nix-eval-jobs": "nix-eval-jobs", "nixpkgs": "nixpkgs", "nixpkgs-wayland": "nixpkgs-wayland", "wezterm": "wezterm" @@ -430,7 +417,6 @@ "treefmt-nix": { "inputs": { "nixpkgs": [ - "nixpkgs-wayland", "nix-eval-jobs", "nixpkgs" ] diff --git a/flake.nix b/flake.nix index 4d24bb3..eb6ed3d 100644 --- a/flake.nix +++ b/flake.nix @@ -2,9 +2,12 @@ description = "daylinmorgan-nixcfg"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland"; nixpkgs-wayland.inputs.nixpkgs.follows = "nixpkgs"; + nixpkgs-wayland.inputs.nix-eval-jobs.follows = "nix-eval-jobs"; + nix-eval-jobs.url = "github:nix-community/nix-eval-jobs"; + nix-eval-jobs.inputs.nixpkgs.follows = "nixpkgs"; hyprland.url = "github:hyprwm/Hyprland/main"; hyprland.inputs.nixpkgs.follows = "nixpkgs"; hyprland-contrib.url = "github:hyprwm/contrib"; @@ -14,19 +17,6 @@ wezterm.inputs.nixpkgs.follows = "nixpkgs"; }; - nixConfig = { - extra-substituters = [ - "https://hyprland.cachix.org" - "https://nixpkgs-wayland.cachix.org" - "https://daylin.cachix.org" - ]; - extra-trusted-public-keys = [ - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" - "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" - "daylin.cachix.org-1:fLdSnbhKjtOVea6H9KqXeir+PyhO+sDSPhEW66ClE/k=" - ]; - }; - outputs = inputs @ { self, nixpkgs, diff --git a/hosts/algiz/default.nix b/hosts/algiz/default.nix index 3ed36c3..d822027 100644 --- a/hosts/algiz/default.nix +++ b/hosts/algiz/default.nix @@ -11,7 +11,7 @@ nim.enable = true; python.enable = true; }; - cli.enable =true; + cli.enable = true; environment.systemPackages = with pkgs; [ rclone diff --git a/hosts/othalan/default.nix b/hosts/othalan/default.nix index 8915f1d..004b63c 100644 --- a/hosts/othalan/default.nix +++ b/hosts/othalan/default.nix @@ -6,7 +6,7 @@ }: { imports = with inputs.self.nixosModules; [ desktop - # hyprland + # hyprland nix-ld virtualization diff --git a/lib/default.nix b/lib/default.nix index 9b06872..84ed405 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -13,8 +13,8 @@ in rec { nixosSystem { system = "x86_64-linux"; modules = - [ ../modules/roles/common.nix ] ++ - builtins.filter isNixFile (listFilesRecursive (../. + "/hosts/${hostname}")); + [../modules/roles/common.nix] + ++ builtins.filter isNixFile (listFilesRecursive (../. + "/hosts/${hostname}")); specialArgs = {inherit inputs;}; }; diff --git a/modules/cli.nix b/modules/cli.nix index ef30dc0..4cbf8c4 100644 --- a/modules/cli.nix +++ b/modules/cli.nix @@ -1,28 +1,28 @@ -{config, lib,pkgs,...}: -let +{ + config, + lib, + pkgs, + ... +}: let inherit (lib) mkEnableOption mkIf; cfg = config.cli; -in -{ +in { options.cli.enable = mkEnableOption "cli"; config = mkIf cfg.enable { + programs.direnv.enable = true; + environment.systemPackages = with pkgs; [ + chezmoi + zoxide + lsd + fzf + # utils + fd + bat + delta + ripgrep - programs.direnv.enable = true; - environment.systemPackages = with pkgs; [ - chezmoi - zoxide - lsd - fzf - - # utils - fd - bat - delta - ripgrep - - btop - - ]; -}; + btop + ]; + }; } diff --git a/modules/fonts.nix b/modules/fonts.nix index ed988bc..4cac252 100644 --- a/modules/fonts.nix +++ b/modules/fonts.nix @@ -1,5 +1,5 @@ -{pkgs,...}:{ -fonts.fontconfig.enable = true; +{pkgs, ...}: { + fonts.fontconfig.enable = true; fonts.packages = with pkgs; [ (nerdfonts.override {fonts = ["FiraCode"];}) ]; diff --git a/modules/hyprland.nix b/modules/hyprland.nix index 919327d..6052ef7 100644 --- a/modules/hyprland.nix +++ b/modules/hyprland.nix @@ -4,39 +4,35 @@ config, lib, ... -}: -let +}: let inherit (lib) mkIf; cfg = config.programs.hyprland; -in -{ +in { config = mkIf cfg.enable { + security.pam.services.swaylock = {}; + programs.hyprland.package = inputs.hyprland.packages.${pkgs.system}.default; + # Optional, hint electron apps to use wayland: + environment.sessionVariables.NIXOS_OZONE_WL = "1"; + environment.systemPackages = with pkgs; [ + swaylock + brightnessctl - security.pam.services.swaylock = {}; - programs.hyprland.package = inputs.hyprland.packages.${pkgs.system}.default; - # Optional, hint electron apps to use wayland: - environment.sessionVariables.NIXOS_OZONE_WL = "1"; - environment.systemPackages = with pkgs; [ - swaylock - brightnessctl + # notifications + libnotify + dunst - # notifications - libnotify - dunst + # screenshots + inputs.hyprland-contrib.packages.${pkgs.system}.grimblast + grim + slurp - # screenshots - inputs.hyprland-contrib.packages.${pkgs.system}.grimblast - grim - slurp + eww-wayland + rofi-wayland + hyprpaper - eww-wayland - rofi-wayland - hyprpaper - - catppuccin-cursors.mochaDark - pavucontrol - ]; - nixpkgs.overlays = [inputs.nixpkgs-wayland.overlay]; - -}; + catppuccin-cursors.mochaDark + pavucontrol + ]; + nixpkgs.overlays = [inputs.nixpkgs-wayland.overlay]; + }; } diff --git a/modules/langs/misc.nix b/modules/langs/misc.nix index 22aec05..81bbbaf 100644 --- a/modules/langs/misc.nix +++ b/modules/langs/misc.nix @@ -1,15 +1,17 @@ -{config, lib,pkgs,...}: -let +{ + config, + lib, + pkgs, + ... +}: let inherit (lib) mkEnableOption mkIf; cfg = config.languages.misc; -in -{ +in { options.languages.misc.enable = mkEnableOption "go + rustup"; config = mkIf cfg.enable { - - environment.systemPackages = with pkgs; [ - go - rustup - ]; -}; + environment.systemPackages = with pkgs; [ + go + rustup + ]; + }; } diff --git a/modules/langs/nim.nix b/modules/langs/nim.nix index 5f656af..700261c 100644 --- a/modules/langs/nim.nix +++ b/modules/langs/nim.nix @@ -1,23 +1,27 @@ -{nixpkgs,config, lib,pkgs,...}: -let +{ + nixpkgs, + config, + lib, + pkgs, + ... +}: let inherit (lib) mkEnableOption mkIf; cfg = config.languages.nim; -in -{ +in { options.languages.nim.enable = mkEnableOption "nim"; config = mkIf cfg.enable { - nixpkgs.overlays = [ - (import ../../overlays/nim {}) - (import ../../overlays/nimlsp {}) - (import ../../overlays/nimble {}) - (import ../../overlays/nim-atlas {}) - ]; + nixpkgs.overlays = [ + #(import ../../overlays/nim {}) + (import ../../overlays/nimlsp {}) + (import ../../overlays/nimble {}) + (import ../../overlays/nim-atlas {}) + ]; - environment.systemPackages = with pkgs; [ - nim-atlas - nim - nimble - nimlsp - ]; -}; + environment.systemPackages = with pkgs; [ + nim-atlas + nim + nimble + nimlsp + ]; + }; } diff --git a/modules/langs/node.nix b/modules/langs/node.nix index 61b9043..f1a99e1 100644 --- a/modules/langs/node.nix +++ b/modules/langs/node.nix @@ -1,14 +1,17 @@ -{config, lib,pkgs,...}: -let +{ + config, + lib, + pkgs, + ... +}: let inherit (lib) mkEnableOption mkIf; cfg = config.languages.node; -in -{ +in { options.languages.node.enable = mkEnableOption "node"; config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [ - nodejs - nodePackages.pnpm - ]; -}; + environment.systemPackages = with pkgs; [ + nodejs + nodePackages.pnpm + ]; + }; } diff --git a/modules/langs/python.nix b/modules/langs/python.nix index 01c82a6..f4d5c87 100644 --- a/modules/langs/python.nix +++ b/modules/langs/python.nix @@ -1,27 +1,28 @@ -{config, lib,pkgs,...}: -let +{ + config, + lib, + pkgs, + ... +}: let inherit (lib) mkEnableOption mkIf; cfg = config.languages.python; -in -{ +in { options.languages.python.enable = mkEnableOption "python"; config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + # https://github.com/Mic92/nix-ld?tab=readme-ov-file#my-pythonnodejsrubyinterpreter-libraries-do-not-find-the-libraries-configured-by-nix-ld + (pkgs.writeShellScriptBin "python" '' + export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH + exec ${pkgs.python3}/bin/python "$@" + '') - environment.systemPackages = with pkgs; [ - # https://github.com/Mic92/nix-ld?tab=readme-ov-file#my-pythonnodejsrubyinterpreter-libraries-do-not-find-the-libraries-configured-by-nix-ld - (pkgs.writeShellScriptBin "python" '' - export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH - exec ${pkgs.python3}/bin/python "$@" - '') + (pkgs.writeShellScriptBin "python3" '' + export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH + exec ${pkgs.python3}/bin/python "$@" + '') - (pkgs.writeShellScriptBin "python3" '' - export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH - exec ${pkgs.python3}/bin/python "$@" - '') - - (python3.withPackages (ps: with ps; [pip])) - micromamba - ]; - -}; + (python3.withPackages (ps: with ps; [pip])) + micromamba + ]; + }; } diff --git a/modules/langs/tex.nix b/modules/langs/tex.nix index d16b499..a464f8d 100644 --- a/modules/langs/tex.nix +++ b/modules/langs/tex.nix @@ -1,13 +1,16 @@ -{config, lib,pkgs,...}: -let +{ + config, + lib, + pkgs, + ... +}: let inherit (lib) mkEnableOption mkIf; cfg = config.languages.tex; -in -{ +in { options.languages.tex.enable = mkEnableOption "tex"; config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [ - texlive.combined.scheme-full - ]; -}; + environment.systemPackages = with pkgs; [ + texlive.combined.scheme-full + ]; + }; } diff --git a/modules/nix.nix b/modules/nix.nix index dc20bed..7c61da3 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -16,14 +16,28 @@ nix.gc = { automatic = true; dates = "weekly"; - options = "--delete-older-than 30d"; + options = "--delete-older-than 7d"; }; + environment.systemPackages = with pkgs; [ nix-output-monitor alejandra ]; - nix.settings = { - trusted-users = ["daylin"]; + nix.settings = { + trusted-users = ["@wheel"]; + accept-flake-config = true; + + # nixConfig = { + substituters = [ + "https://hyprland.cachix.org" + "https://nixpkgs-wayland.cachix.org" + "https://daylin.cachix.org" + ]; + trusted-public-keys = [ + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" + "daylin.cachix.org-1:fLdSnbhKjtOVea6H9KqXeir+PyhO+sDSPhEW66ClE/k=" + ]; }; } diff --git a/modules/qtile.nix b/modules/qtile.nix index 0de5f2c..94e1a46 100644 --- a/modules/qtile.nix +++ b/modules/qtile.nix @@ -7,7 +7,6 @@ ./lock ]; - # Enable the X11 windowing system. services.xserver = { enable = true; diff --git a/modules/vpn.nix b/modules/vpn.nix index b0db6d7..328738b 100644 --- a/modules/vpn.nix +++ b/modules/vpn.nix @@ -1,5 +1,9 @@ -{config, lib,pkgs,...}: -let +{ + config, + lib, + pkgs, + ... +}: let inherit (lib) mkEnableOption mkIf; cfg = config.services.vpn; in {