Compare commits

..

No commits in common. "38b3c2c262f9af5267c40fbeabdf2937ecca7236" and "1237a5c0923dfe9a807111738a9ea210cd6dc0b9" have entirely different histories.

7 changed files with 50 additions and 132 deletions

View file

@ -12,64 +12,9 @@ with inputs.nixpkgs.lib; {
extraModules ? [], extraModules ? [],
}: let }: let
system = platform; system = platform;
secrets = builtins.toString inputs.secrets; secrets = builtins.toString inputs.secrets;
pull-requests = {
fluffychat = import nixpkgs-pr-fluffychat {
inherit system;
overlays = [
(final: prev: {
fluffychat = prev.fluffychat.overrideAttrs (prevAttrs: rec {
desktopItems = [
((builtins.elemAt prevAttrs.desktopItems 0).override {startupWMClass = "fluffychat";})
];
});
})
];
};
feishin = import nixpkgs-pr-feishin {
inherit system;
overlays = [
(final: prev: {
feishin = prev.feishin.overrideAttrs (prevAttrs: rec {
pname = "feishin";
version = "0.18.0";
src = prev.fetchFromGitHub {
owner = "jeffvli";
repo = "feishin";
rev = "v${version}";
hash = "sha256-4gcS7Vd7LSpEByO2Hlk6nb8V2adBPh5XwWGCu2lwOA4=";
};
pnpmDeps = prev.pnpm_10.fetchDeps {
inherit pname version src;
hash = "sha256-1MGxrUcfvazxAubaYAsQuulUKm05opWOIC7oaLzjr7o=";
};
});
})
];
};
};
userPackages = final: prev: {
# WebOne HTTP proxy.
webone = prev.pkgs.callPackage ./packages/webone {};
# Yazi Gruvbox theme.
yazi-flavour-gruvbox-dark = prev.pkgs.callPackage ./packages/yazi-flavour-gruvbox {};
# Latest FluffyChat.
fluffychat = pull-requests.fluffychat.fluffychat;
# Latest Feishin.
feishin = pull-requests.feishin.feishin;
# PrismLauncher with Temurin JRE.
prismlauncher = prev.prismlauncher.override {
jdks = [
prev.pkgs.temurin-jre-bin
];
};
};
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
config = { config = {
@ -79,12 +24,9 @@ with inputs.nixpkgs.lib; {
"dotnet-runtime-6.0.36" "dotnet-runtime-6.0.36"
]; ];
}; };
overlays = [
userPackages
];
}; };
deployPkgs = import nixpkgs { pkgs-deploy-rs = import nixpkgs {
inherit system; inherit system;
overlays = [ overlays = [
deploy-rs.overlays.default deploy-rs.overlays.default
@ -96,6 +38,13 @@ with inputs.nixpkgs.lib; {
}) })
]; ];
}; };
userPackages = {
fluffychat = (import nixpkgs-pr-fluffychat {inherit system;}).fluffychat;
feishin = (import nixpkgs-pr-feishin {inherit system;}).feishin;
webone = pkgs.callPackage ./packages/webone {};
yazi-flavour-gruvbox-dark = pkgs.callPackage ./packages/yazi-flavour-gruvbox {};
};
in in
{ {
nixosConfigurations.${hostname} = nixosSystem { nixosConfigurations.${hostname} = nixosSystem {
@ -103,11 +52,13 @@ with inputs.nixpkgs.lib; {
specialArgs = { specialArgs = {
inherit inherit
nixpkgs
hostname hostname
platform platform
suite suite
user user
secrets secrets
userPackages
; # Inherit variables. ; # Inherit variables.
}; };
@ -122,15 +73,13 @@ with inputs.nixpkgs.lib; {
++ extraModules; ++ extraModules;
}; };
} }
// optionalAttrs ((suite == "server") // optionalAttrs (suite != "desktop") {
|| (suite == "vm")
|| (suite == "lxc")) {
deploy.nodes.${hostname} = { deploy.nodes.${hostname} = {
hostname = "${hostname}.local"; hostname = "${hostname}.local";
profiles.system = { profiles.system = {
user = "root"; user = "root";
sshUser = user; sshUser = user;
path = deployPkgs.deploy-rs.lib.activate.nixos self.nixosConfigurations.${hostname}; path = pkgs-deploy-rs.deploy-rs.lib.activate.nixos self.nixosConfigurations.${hostname};
}; };
}; };
}; };

View file

@ -42,7 +42,6 @@
}; };
}; };
}; };
# Open ports for services. # Open ports for services.
networking.firewall = { networking.firewall = {
allowedUDPPorts = [ allowedUDPPorts = [

View file

@ -1,7 +1,7 @@
{ {
config, config,
lib, lib,
pkgs, userPackages,
... ...
}: }:
with lib; let with lib; let
@ -47,13 +47,13 @@ in {
startLimitIntervalSec = 5; startLimitIntervalSec = 5;
startLimitBurst = 3; startLimitBurst = 3;
environment = { environment = {
OPENSSL_CONF = "${pkgs.webone}/lib/webone/openssl_webone.cnf"; OPENSSL_CONF = "${userPackages.webone}/lib/webone/openssl_webone.cnf";
}; };
serviceConfig = { serviceConfig = {
Type = "simple"; Type = "simple";
User = "webone"; User = "webone";
Group = "webone"; Group = "webone";
ExecStart = "${pkgs.webone}/bin/webone"; ExecStart = "${userPackages.webone}/bin/webone";
TimeoutStopSec = "10"; TimeoutStopSec = "10";
Restart = "on-failure"; Restart = "on-failure";
RestartSec = "5"; RestartSec = "5";

View file

@ -1,43 +0,0 @@
inputs:
with inputs; (super: self: {
webone = super.pkgs.callPackage ./packages/webone {};
yazi-flavour-gruvbox-dark = super.pkgs.callPackage ./packages/yazi-flavour-gruvbox {};
pr.fluffychat = import nixpikgs-pr-fluffychat {inherit system;};
pr.feishin = import nixpkgs-pr-feishin {
inherit system;
overlays = [
(self: super: {
feishin = super.feishin.overrideAttrs (old: rec {
pname = "feishin";
version = "0.18.0";
src = super.fetchFromGitHub {
owner = "jeffvli";
repo = "feishin";
rev = "v${version}";
hash = "sha256-4gcS7Vd7LSpEByO2Hlk6nb8V2adBPh5XwWGCu2lwOA4=";
};
pnpmDeps = super.pnpm_10.fetchDeps {
inherit pname version src;
hash = "sha256-1MGxrUcfvazxAubaYAsQuulUKm05opWOIC7oaLzjr7o=";
};
});
})
];
};
deploy-rs = import nixpkgs {
inherit system;
overlays = [
deploy-rs.overlays.default
(self: super: {
deploy-rs = {
inherit (pkgs) deploy-rs;
lib = super.deploy-rs.lib;
};
})
];
};
})

View file

@ -1,4 +1,6 @@
{ {
nixpkgs,
userPackages,
pkgs, pkgs,
lib, lib,
hostname, hostname,
@ -18,6 +20,9 @@ with lib; {
# Add @wheel to trusted-users for remote deployments. # Add @wheel to trusted-users for remote deployments.
nix.settings.trusted-users = ["root" "@wheel"]; nix.settings.trusted-users = ["root" "@wheel"];
# Set $NIX_PATH to flake input.
nix.nixPath = ["nixpkgs=${nixpkgs}"];
# Enable redistributable firmware. # Enable redistributable firmware.
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;
@ -72,7 +77,7 @@ with lib; {
# yazi cd on quit. # yazi cd on quit.
function y function y
set tmp (mktemp -t "yazi-cwd.XXXXXX") set tmp (mktemp -t "yazi-cwd.XXXXXX")
yazi $argv --cwd-file="$tmp" ${pkgs.yazi}/bin/yazi $argv --cwd-file="$tmp"
if read -z cwd < "$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] if read -z cwd < "$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
builtin cd -- "$cwd" builtin cd -- "$cwd"
end end
@ -84,10 +89,10 @@ with lib; {
# https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell # https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell
programs.bash = { programs.bash = {
interactiveShellInit = '' interactiveShellInit = ''
if [[ $(ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec fish $LOGIN_OPTION exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi fi
''; '';
}; };
@ -102,26 +107,19 @@ with lib; {
nixvim = { nixvim = {
enable = true; enable = true;
defaultEditor = true;
# For telescope.
dependencies.ripgrep.enable = true; dependencies.ripgrep.enable = true;
# Space as leader.
globals.mapleader = " "; globals.mapleader = " ";
keymaps = [ keymaps = [
{ {
key = "<Leader>t"; key = "<Leader>tt";
action = "<cmd> ToggleTerm direction=float <CR>"; action = "<cmd> ToggleTerm direction=float <CR>";
} }
{ {
key = "<Leader>x"; key = "<Leader>xx";
action = "<cmd> Trouble diagnostics toggle focus=false <CR>"; action = "<cmd> Trouble diagnostics toggle focus=false<CR>";
}
{
key = "<Leader>y";
action = "<cmd> Yazi <CR>";
} }
]; ];
@ -153,7 +151,6 @@ with lib; {
toggleterm.enable = true; toggleterm.enable = true;
trouble.enable = true; trouble.enable = true;
web-devicons.enable = true; web-devicons.enable = true;
yazi.enable = true;
lualine = { lualine = {
enable = true; enable = true;
@ -224,7 +221,7 @@ with lib; {
programs.yazi = { programs.yazi = {
enable = true; enable = true;
flavors."gruvbox-dark.yazi" = pkgs.yazi-flavour-gruvbox-dark; flavors."gruvbox-dark.yazi" = userPackages.yazi-flavour-gruvbox-dark;
settings.theme = { settings.theme = {
flavor.dark = "gruvbox-dark"; flavor.dark = "gruvbox-dark";
}; };

View file

@ -1,5 +1,6 @@
{ {
pkgs, pkgs,
userPackages,
lib, lib,
... ...
}: }:
@ -47,8 +48,8 @@ with lib; {
services.xserver = { services.xserver = {
enable = true; enable = true;
excludePackages = [ excludePackages = with pkgs; [
pkgs.xterm # Don't install xterm. xterm # Don't install xterm.
]; ];
displayManager.gdm.enable = true; displayManager.gdm.enable = true;
@ -104,8 +105,6 @@ with lib; {
celluloid celluloid
deploy-rs deploy-rs
discord discord
feishin
fluffychat
ghostty ghostty
gimp3 gimp3
glabels-qt glabels-qt
@ -119,12 +118,27 @@ with lib; {
merriweather-sans merriweather-sans
nerd-fonts.fira-code nerd-fonts.fira-code
obsidian obsidian
prismlauncher
prismlauncher
protonmail-desktop protonmail-desktop
signal-desktop signal-desktop
smile smile
userPackages.feishin
yubioath-flutter yubioath-flutter
# PrismLauncher with temurin jre.
(prismlauncher.override {
jdks = [
temurin-jre-bin
];
})
# FluffyChat 2.0.0 with fixed desktop item.
(userPackages.fluffychat.overrideAttrs (
finalAttrs: previousAttrs: {
desktopItems = [
((builtins.elemAt previousAttrs.desktopItems 0).override {startupWMClass = "fluffychat";})
];
}
))
]; ];
# Allow opening terminal applications from gnome app launcher. # Allow opening terminal applications from gnome app launcher.

View file

@ -23,6 +23,8 @@ with lib; {
users.users.${user} = { users.users.${user} = {
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIETPyuxUVEmYyEW6PVC6BXqkhULHd/RvMm8fMbYhjTMV fern@muskduck" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIETPyuxUVEmYyEW6PVC6BXqkhULHd/RvMm8fMbYhjTMV fern@muskduck"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKzW4epTmK01kGVXcuAXUNJQPltnogf4uab9FA5m8S3n fern@pardalote"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBEJYq1fMxVOzCMfE/td6DtWS8nUk76U9seYD3Z9RYAz u0_a399@fairywren"
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIMoJvPcUJDVVzO4dHROCFNlgJdDZSP5xyPx2s40zcx5QAAAABHNzaDo= YubiKey5NFC" "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIMoJvPcUJDVVzO4dHROCFNlgJdDZSP5xyPx2s40zcx5QAAAABHNzaDo= YubiKey5NFC"
]; ];
extraGroups = mkIf (user == "docker") ["docker"]; # if docker is enabled. extraGroups = mkIf (user == "docker") ["docker"]; # if docker is enabled.