diff --git a/computers/shared/aliases.nix b/computers/shared/aliases.nix new file mode 100644 index 0000000..ace9f73 --- /dev/null +++ b/computers/shared/aliases.nix @@ -0,0 +1,16 @@ +{pkgs, ...}: let + ezaOptions = "--colour=always --icons=never --group-directories-first --octal-permissions"; +in { + config = { + environment = { + shellAliases = builtins.mapAttrs (_: v: "${v} ${ezaOptions}") { + l = "eza -alh"; + ls = "eza"; + ll = "eza -l"; + }; + systemPackages = [ + pkgs.eza + ]; + }; + }; +} diff --git a/computers/shared/default.nix b/computers/shared/default.nix index e6b9a7c..2718f42 100644 --- a/computers/shared/default.nix +++ b/computers/shared/default.nix @@ -7,5 +7,10 @@ ./pipewire.nix ./mpd.nix ./fonts.nix + ./emacs.nix + ./ssh.nix + ./direnv.nix + ./xonsh.nix + ./aliases.nix ]; } diff --git a/computers/shared/direnv.nix b/computers/shared/direnv.nix new file mode 100644 index 0000000..862c1bb --- /dev/null +++ b/computers/shared/direnv.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + ... +}: let + cfg = config.alqueva.direnv; +in { + options.alqueva.direnv = { + enable = lib.mkEnableOption "direnv"; + }; + + config = lib.mkIf cfg.enable { + programs.direnv = { + enable = true; + silent = true; + nix-direnv.enable = true; + direnvrcExtra = '' + echo "direnv version: ${config.programs.direnv.package.version}" + echo "shell version: ${config.users.defaultUserShell.pname} ${config.users.defaultUserShell.version}" + ''; + }; + }; +} diff --git a/computers/shared/emacs.nix b/computers/shared/emacs.nix new file mode 100644 index 0000000..f1f8962 --- /dev/null +++ b/computers/shared/emacs.nix @@ -0,0 +1,19 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: let + cfg = config.alqueva.emacs; +in { + options.alqueva.emacs = { + enable = lib.mkEnableOption "Emacs"; + }; + config = lib.mkIf cfg.enable { + environment = { + systemPackages = [inputs.pankomacs.packages.${pkgs.system}.pankomacs]; + sessionVariables."EDITOR" = "emacs"; + }; + }; +} diff --git a/computers/shared/fish.nix b/computers/shared/fish.nix index f7e921d..c01dc36 100644 --- a/computers/shared/fish.nix +++ b/computers/shared/fish.nix @@ -1,5 +1,6 @@ { config, + pkgs, lib, ... }: let @@ -9,13 +10,28 @@ in { enable = lib.mkEnableOption "fish"; }; config = lib.mkIf cfg.enable { - programs.fish = { - vendor = { - functions.enable = true; - config.enable = true; - completions.enable = true; + programs = { + fish = { + vendor = { + functions.enable = true; + config.enable = true; + completions.enable = true; + }; + enable = true; }; - enable = true; + starship = { + enable = true; + presets = ["no-nerd-font"]; + }; + }; + + environment.systemPackages = builtins.attrValues { + inherit + (pkgs.fishPlugins) + fzf-fish + forgit + autopair + ; }; }; } diff --git a/computers/shared/fonts.nix b/computers/shared/fonts.nix index f6754b1..32c607d 100644 --- a/computers/shared/fonts.nix +++ b/computers/shared/fonts.nix @@ -6,53 +6,45 @@ }: let cfg = config.alqueva.fonts; inherit (lib) types mkOption; - fontSubmodule = fontPackages: fontNames: { - options = { - packages = mkOption { - type = types.listOf types.package; - default = fontPackages; - description = "Package of the font used."; - }; - names = mkOption { - type = types.listOf types.str; - default = fontNames; - description = "Name of the default font you will be using."; - }; - }; - }; - mkFontOption = fontType: fontPackages: fontNames: + mkStringsOption = default: letterform: mkOption { - type = types.submodule (fontSubmodule fontPackages fontNames); - description = "Options for the ${fontType} letterform."; + type = types.listOf types.str; + inherit default; + description = "Which ${letterform} font packages you want to use."; }; in { options.alqueva.fonts = { - enable = mkEnableOption "" // {description = "Whether you want to use this fonts module.";}; - sansSerif = mkFontOption "sans-serif" [pkgs.roboto] ["Roboto"]; - monospace = mkFontOption "monospace" [pkgs.roboto-mono] ["Roboto Mono"]; - serif = mkFontOption "serif" [pkgs.roboto-serif] ["Roboto Serif"]; - emoji = mkFontOption "emoji" [pkgs.noto-fonts-color-emoji] ["Noto Color Emoji"]; - extraPackages = mkOption { + enable = lib.mkEnableOption "" // {description = "Whether you want to use this fonts module.";}; + packages = mkOption { type = types.listOf types.package; - default = []; - description = "Extra font packages to be installed."; + default = [pkgs.roboto pkgs.roboto-serif pkgs.roboto-mono pkgs.noto-fonts-color-emoji]; + description = "Packages related to fonts to be installed."; + }; + names = builtins.mapAttrs (_n: v: mkStringsOption v.default v.letterform) { + sansSerif = { + default = ["Roboto"]; + letterform = "sans-serif"; + }; + monospace = { + default = ["Roboto Mono"]; + letterform = "monospace"; + }; + serif = { + default = ["Roboto Serif"]; + letterform = "serif"; + }; + emoji = { + default = ["Noto Color Emoji"]; + letterform = "emoji"; + }; }; }; config = lib.mkIf cfg.enable { fonts = { - packages = builtins.concatLists [ - cfg.extraPackages - cfg.sansSerif.packages - cfg.monospace.packages - cfg.serif.packages - cfg.emoji.packages - ]; + inherit (cfg) packages; fontconfig = { defaultFonts = { - sansSerif = cfg.sansSerif.names; - monospace = cfg.monospace.names; - serif = cfg.serif.names; - emoji = cfg.emoji.names; + inherit (cfg.names) sansSerif monospace serif emoji; }; enable = true; }; diff --git a/computers/shared/mpd.nix b/computers/shared/mpd.nix index b518304..10a3ab5 100644 --- a/computers/shared/mpd.nix +++ b/computers/shared/mpd.nix @@ -18,6 +18,7 @@ in { config = lib.mkIf cfg.enable { services.mpd.enable = true; environment.systemPackages = - lib.optional cfg.ncmpcpp pkgs.ncmpcpp; + [pkgs.mpd] + ++ lib.optional cfg.ncmpcpp pkgs.ncmpcpp; }; } diff --git a/computers/shared/pipewire.nix b/computers/shared/pipewire.nix index 965e34a..e4425f4 100644 --- a/computers/shared/pipewire.nix +++ b/computers/shared/pipewire.nix @@ -14,6 +14,7 @@ in { services.pipewire = { enable = true; alsa.enable = true; + jack.enable = true; pulse.enable = true; wireplumber.enable = true; }; diff --git a/computers/shared/qutebrowser.nix b/computers/shared/qutebrowser.nix index bf94401..fd9f7c8 100644 --- a/computers/shared/qutebrowser.nix +++ b/computers/shared/qutebrowser.nix @@ -12,9 +12,7 @@ in { config = lib.mkIf cfg.enable { environment.systemPackages = [ - (pkgs.qutebrowser-qt5.override { - enableVulkan = true; - }) + pkgs.qutebrowser ]; }; } diff --git a/computers/shared/ssh.nix b/computers/shared/ssh.nix new file mode 100644 index 0000000..bf82215 --- /dev/null +++ b/computers/shared/ssh.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + ... +}: let + cfg = config.alqueva.openssh; +in { + options.alqueva.openssh = { + enable = lib.mkEnableOption "OpenSSH"; + }; + + config = lib.mkIf cfg.enable { + programs.ssh.enableAskPassword = true; + services.openssh.enable = true; + }; +} diff --git a/computers/shared/xonsh.nix b/computers/shared/xonsh.nix new file mode 100644 index 0000000..9094dcd --- /dev/null +++ b/computers/shared/xonsh.nix @@ -0,0 +1,63 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.alqueva.xonsh; + inherit (pkgs) fetchFromGitHub; +in { + options.alqueva.xonsh = { + enable = lib.mkEnableOption "xonsh"; + }; + + config = lib.mkIf cfg.enable { + programs = { + xonsh = { + config = + "from xonsh.xontribs import get_xontribs\n" + + lib.concatStringsSep "\n" (builtins.attrValues (builtins.mapAttrs (n: v: "aliases['${n}'] = '${v}'\n") config.environment.shellAliases)) + + '' + for $xontrib in get_xontribs(): + xontrib load $xontrib + + execx($(zoxide init xonsh --cmd j), 'exec', __xonsh__.ctx, filename='zoxide') + ''; + package = pkgs.xonsh.override { + extraPackages = ps: [ + (let + name = "xontrib-fish-completer"; + version = "0.0.1"; + in + ps.buildPythonPackage { + inherit name version; + src = fetchFromGitHub { + owner = "xonsh"; + repo = name; + rev = version; + hash = "sha256-PhhdZ3iLPDEIG9uDeR5ctJ9zz2+YORHBhbsiLrJckyA="; + }; + }) + (let + name = "xontrib-prompt-bar"; + version = "0.5.8"; + in + ps.buildPythonPackage { + inherit name version; + src = fetchFromGitHub { + owner = "anki-code"; + repo = name; + rev = version; + hash = "sha256-n80XDApfoUJQORSzIY1FACLeL++HKmIxcz4MAeQ3CZ0="; + }; + }) + ]; + }; + enable = true; + }; + }; + environment.systemPackages = [ + pkgs.zoxide + ]; + }; +} diff --git a/computers/toothless/default.nix b/computers/toothless/default.nix index 6af8e4b..8bf829b 100644 --- a/computers/toothless/default.nix +++ b/computers/toothless/default.nix @@ -16,17 +16,14 @@ }; services = { - desktopManager.plasma6 = { - enable = true; - enableQt5Integration = false; - notoPackage = pkgs.noto-fonts-lgc-plus; - }; - xserver.xkb = { layout = "us"; options = "eurosign:e,ctrl:nocaps"; }; - + desktopManager.plasma6 = { + enable = true; + enableQt5Integration = false; + }; libinput.enable = true; openssh.enable = true; }; @@ -44,28 +41,39 @@ deadnix alejandra wget + vesktop + nicotine-plus + mpv + imv + wl-clipboard ; }; alqueva = { - sddm.enable = true; - git.enable = true; - qutebrowser.enable = true; - pipewire.enable = true; mpd = { enable = true; ncmpcpp = true; }; fonts = { - sansSerif = {}; - monospace = {}; - serif = {}; - emoji = {}; - extraPackages = [ - pkgs.nerdfonts + names = { + sansSerif = ["Fairfax SM"]; + monospace = ["Fairfax SM"]; + serif = ["Fairfax SM"]; + }; + packages = [ + (pkgs.nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];}) + pkgs.fairfax + pkgs.font-awesome ]; enable = true; }; + sddm.enable = true; + emacs.enable = true; + git.enable = true; + qutebrowser.enable = true; + pipewire.enable = true; + openssh.enable = true; + direnv.enable = true; }; programs.neovim.enable = true; diff --git a/flake.lock b/flake.lock index 1855332..4e0f37d 100644 --- a/flake.lock +++ b/flake.lock @@ -1,15 +1,35 @@ { "nodes": { + "astal": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730210962, + "narHash": "sha256-qQ5Inu3T/cKteV46wTvw+ONWi32pbDZ7DIC59N561nk=", + "owner": "aylur", + "repo": "astal", + "rev": "8705ab494f448c508c43c4272b501a3f3bdbac70", + "type": "github" + }, + "original": { + "owner": "aylur", + "repo": "astal", + "type": "github" + } + }, "disko": { "inputs": { "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1729099656, - "narHash": "sha256-VftVIg7UXTy1bq+tzi1aVYOWl7PQ35IpjW88yMYjjpc=", + "lastModified": 1730190761, + "narHash": "sha256-o5m5WzvY6cGIDupuOvjgNSS8AN6yP2iI9MtUC6q/uos=", "owner": "nix-community", "repo": "disko", - "rev": "d7d57edb72e54891fa67a6f058a46b2bb405663b", + "rev": "3979285062d6781525cded0f6c4ff92e71376b55", "type": "github" }, "original": { @@ -18,6 +38,29 @@ "type": "github" } }, + "emacs": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "pankomacs", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable_2" + }, + "locked": { + "lastModified": 1724951607, + "narHash": "sha256-cOCOZOilbAtW29FaYZEP/K/Tf8E6VeWGrKJlK+GRe2M=", + "owner": "nix-community", + "repo": "emacs-overlay", + "rev": "33812cad36ad7826d7eb9bd72eb11995be20cff6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "emacs-overlay", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -54,6 +97,24 @@ "type": "github" } }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "git-hooks-nix": { "inputs": { "flake-compat": "flake-compat", @@ -128,6 +189,22 @@ "type": "github" } }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1724727824, + "narHash": "sha256-0XH9MJk54imJm+RHOLTUJ7e+ponLW00tw5ke4MTVa1Y=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "36bae45077667aff5720e5b3f1a5458f51cf0776", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1719082008, @@ -146,11 +223,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1728888510, - "narHash": "sha256-nsNdSldaAyu6PE3YUA+YQLqUDJh+gRbBooMMekZJwvI=", + "lastModified": 1729880355, + "narHash": "sha256-RP+OQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c", + "rev": "18536bf04cd71abd345f9579158841376fdd0c5a", "type": "github" }, "original": { @@ -161,6 +238,22 @@ } }, "nixpkgs_4": { + "locked": { + "lastModified": 1724748588, + "narHash": "sha256-NlpGA4+AIf1dKNq76ps90rxowlFXUsV9x7vK/mN37JM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "a6292e34000dc93d43bccf78338770c1c5ec8a99", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { "locked": { "lastModified": 1725103162, "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", @@ -176,12 +269,76 @@ "type": "github" } }, + "pankomacs": { + "inputs": { + "emacs": "emacs", + "nixpkgs": "nixpkgs_4", + "parts": "parts" + }, + "locked": { + "lastModified": 1729519091, + "narHash": "sha256-fGkNTncOHLQZGcblqUPdoXyeEXuDDNWUa4K3e51n98E=", + "ref": "refs/heads/main", + "rev": "ba6a74607fc16833e18239232e8f10fcc8c78314", + "revCount": 68, + "type": "git", + "url": "https://codeberg.org/amadaluzia/pankomacs.git" + }, + "original": { + "type": "git", + "url": "https://codeberg.org/amadaluzia/pankomacs.git" + } + }, + "parts": { + "inputs": { + "nixpkgs-lib": [ + "pankomacs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "quickshell": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730157521, + "narHash": "sha256-xyodl47NDih2SEYbRkAvv6lPbjjA/E9B0TlCLnGIFa8=", + "ref": "refs/heads/master", + "rev": "4e48c6eefb399abfcdefbe046a6a642bdcfcc1a6", + "revCount": 358, + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell" + }, + "original": { + "type": "git", + "url": "https://git.outfoxxed.me/quickshell/quickshell" + } + }, "root": { "inputs": { + "astal": "astal", "disko": "disko", "flake-parts": "flake-parts", "git-hooks-nix": "git-hooks-nix", "nixpkgs": "nixpkgs_3", + "pankomacs": "pankomacs", + "quickshell": "quickshell", "wallpkgs": "wallpkgs" } }, @@ -200,10 +357,25 @@ "type": "github" } }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "wallpkgs": { "inputs": { - "nixpkgs": "nixpkgs_4", - "systems": "systems" + "nixpkgs": "nixpkgs_5", + "systems": "systems_2" }, "locked": { "lastModified": 1728261155, diff --git a/flake.nix b/flake.nix index 45abad5..39f33cb 100644 --- a/flake.nix +++ b/flake.nix @@ -28,6 +28,18 @@ owner = "notashelf"; repo = "wallpkgs"; }; + astal = { + type = "github"; + owner = "aylur"; + repo = "astal"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + quickshell = { + type = "git"; + url = "https://git.outfoxxed.me/quickshell/quickshell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + pankomacs.url = "git+https://codeberg.org/amadaluzia/pankomacs.git"; }; outputs = inputs @ { nixpkgs, diff --git a/lib/default.nix b/lib/default.nix index 47af4fd..ef1f3bf 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -14,7 +14,7 @@ inputs.self.nixosModules.default ({config, ...}: { config = { - alqueva.fish.enable = true; + alqueva.xonsh.enable = true; nix = { settings.extra-experimental-features = [ "nix-command" @@ -25,15 +25,12 @@ dates = "weekly"; }; }; - users = { - users.${user} = { - isNormalUser = true; - useDefaultShell = true; - initialPassword = "password"; - extraGroups = ["wheel" "networkmanager" "video" "audio" "input" "libvirtd"]; - name = user; - }; - defaultUserShell = config.programs.fish.package; + users.users.${user} = { + isNormalUser = true; + shell = config.programs.xonsh.package; + initialPassword = "password"; + extraGroups = ["wheel" "networkmanager" "video" "audio" "input" "libvirtd"]; + name = user; }; environment.shellAliases = { rebs = "nixos-rebuild --use-remote-sudo switch --flake .#${host}"; diff --git a/overlays/default.nix b/overlays/default.nix index 5449c9c..5fa64c3 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -21,7 +21,7 @@ }; packages = { - inherit (pkgs) i-found-my-sddm-theme fairfax; + inherit (pkgs) i-found-my-sddm-theme fairfax xonsh; }; }; } diff --git a/overlays/derivations/fairfax.nix b/overlays/derivations/fairfax.nix index fafc175..5b21b4a 100644 --- a/overlays/derivations/fairfax.nix +++ b/overlays/derivations/fairfax.nix @@ -4,14 +4,14 @@ lib, }: stdenvNoCC.mkDerivation { - pname = "fairfaxHD"; + pname = "fairfax"; version = "20240601"; src = lib.cleanSourceWith { filter = _path: type: type == "regular"; src = fetchzip { - url = "https://github.com/kreativekorp/open-relay/releases/download/2024-06-01/FairfaxHD.zip"; - hash = "sha256-kwdpWFOYhXt0HNqfWP3EeKYhJWgKsRs7cAbzHEasM80="; - stripRoot = true; + url = "https://github.com/kreativekorp/open-relay/releases/download/2024-06-01/Fairfax.zip"; + hash = "sha256-rUl/C250pJBal69ThtWhPMFe182nnZmk5UUA7eDrZeA="; + stripRoot = false; }; }; installPhase = ''