Run formatter over project. Tidy up laptop packages.

This commit is contained in:
Fern Garden 2025-07-10 18:14:36 +08:00
parent 5b08fb0d7f
commit 091c1562f2
14 changed files with 205 additions and 210 deletions

View file

@ -6,12 +6,13 @@
lanzaboote.url = "github:nix-community/lanzaboote"; # Secure boot.
nixos-hardware.url = "github:NixOS/nixos-hardware"; # Hardware specific config.
sops-nix.url = "github:Mic92/sops-nix"; # Secrets management.
nixvim.url = "github:nix-community/nixvim"; # Neovim.
# Secrets repo.
secrets = {
url = "git+ssh://git@docker.local:222/fern/secrets?ref=main";
flake = false;
};
nixvim.url = "github:nix-community/nixvim"; # Neovim.
# Packages.
fluffychat-2_0_0.url = "github:NixOS/nixpkgs?ref=pull/419632/head"; # FluffyChat 2.0.0
@ -19,12 +20,11 @@
};
outputs = inputs @ {
self,
nixpkgs,
lanzaboote,
nixos-hardware,
sops-nix,
nixvim,
sops-nix,
fluffychat-2_0_0,
feishin-0_17_0,
...
@ -53,7 +53,7 @@
specialArgs = {
inherit
self
nixpkgs
hostname
suite
platform

View file

@ -13,8 +13,7 @@
fsType = "ext4";
};
boot.initrd.luks.devices."luks-93fa00bc-777f-4359-bad5-880c29faca0d".device =
"/dev/disk/by-uuid/93fa00bc-777f-4359-bad5-880c29faca0d";
boot.initrd.luks.devices."luks-93fa00bc-777f-4359-bad5-880c29faca0d".device = "/dev/disk/by-uuid/93fa00bc-777f-4359-bad5-880c29faca0d";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/EBD7-3E1C";

View file

@ -1,5 +1,9 @@
{ config, pkgs, secrets, ... }:
{
config,
pkgs,
secrets,
...
}: {
# Secrets.
sops = {
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_rpi4;
initrd.availableKernelModules = [

View file

@ -4,11 +4,9 @@
userPackages,
...
}:
with lib;
let
with lib; let
cfg = config.services.webone;
in
{
in {
options.services.webone.enable = mkEnableOption "Enable WebOne HTTP proxy.";
config = mkIf cfg.enable {

View file

@ -4,7 +4,6 @@
dotnetCorePackages,
...
}:
buildDotnetModule rec {
pname = "webone";
version = "0.17.5";

View file

@ -1,9 +1,7 @@
# This file was automatically generated by passthru.fetch-deps.
# Please dont edit it manually, your changes might get overwritten!
# TODO: This format file is obsolete, consider migrating to JSON.
{ fetchNuGet }:
[
{fetchNuGet}: [
(fetchNuGet {
pname = "Microsoft.NETCore.Platforms";
version = "3.1.0";

View file

@ -1,5 +1,5 @@
{
self,
nixpkgs,
pkgs,
lib,
hostname,
@ -10,15 +10,15 @@ with lib; {
# NixOS version.
system.stateVersion = "25.05";
# Set $NIX_PATH to flake input.
nix.nixPath = ["nixpkgs=${self.inputs.nixpkgs}"];
# Enable flakes.
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# Set $NIX_PATH to flake input.
nix.nixPath = ["nixpkgs=${nixpkgs}"];
# Enable redistributable firmware.
hardware.enableRedistributableFirmware = true;
@ -66,25 +66,14 @@ with lib; {
programs.fish = {
enable = true;
interactiveShellInit = ''
# nnn cd on quit.
function n --wraps nnn --description 'support nnn quit and change directory'
if test -n "$NNNLVL" -a "$NNNLVL" -ge 1
echo "nnn is already running"
return
end
if test -n "$XDG_CONFIG_HOME"
set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
else
set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd"
end
command ${pkgs.nnn}/bin/nnn $argv
if test -e $NNN_TMPFILE
source $NNN_TMPFILE
rm -- $NNN_TMPFILE
# yazi cd on quit.
function y
set tmp (mktemp -t "yazi-cwd.XXXXXX")
${pkgs.yazi}/bin/yazi $argv --cwd-file="$tmp"
if read -z cwd < "$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
builtin cd -- "$cwd"
end
rm -f -- "$tmp"
end
# kanagawa theme.
@ -123,6 +112,7 @@ with lib; {
'';
};
# https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell
programs.bash = {
interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
@ -131,13 +121,14 @@ with lib; {
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
}; # https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell
};
# Install some packages.
programs.git.enable = true;
programs.lazygit.enable = true;
programs = {
git.enable = true;
lazygit.enable = true;
programs.nixvim = {
nixvim = {
enable = true;
globals.mapleader = " ";
@ -154,24 +145,38 @@ with lib; {
}
{
key = "<Leader>e";
action = "<cmd> Neotree toggle <CR>";
key = "<Leader>g";
action = "<cmd> LazyGit <CR>";
mode = "n";
options.desc = "Open LazyGit.";
}
{
key = "<Leader>y";
action = "<cmd> Yazi toggle <CR>";
mode = "n";
options.desc = "Show/hide file browser.";
}
{
key = "<Leader>f";
key = "<Leader>ff";
action = "<cmd> Telescope fd <CR>";
mode = "n";
options.desc = "Find files.";
}
{
key = "<Leader>g";
action = "<cmd> LazyGit <CR>";
key = "<Leader>fb";
action = "<cmd> Telescope buffers <CR>";
mode = "n";
options.desc = "Open LazyGit.";
options.desc = "Switch between buffers with telescope.";
}
{
key = "<Leader>fg";
action = "<cmd> Telescope live_grep <CR>";
mode = "n";
options.desc = "Grep files.";
}
];
@ -233,6 +238,7 @@ with lib; {
trouble.enable = true;
web-devicons.enable = true;
which-key.enable = true;
yazi.enable = true;
blink-cmp = {
enable = true;
@ -265,16 +271,17 @@ with lib; {
};
};
};
};
environment.systemPackages = with pkgs; [
aria2
btop
lynx
ncdu
nnn
rsync
tmux
trash-cli
yazi
];
# Enable avahi hostname resolution.

View file

@ -4,8 +4,7 @@
lib,
...
}:
with lib;
{
with lib; {
# Configure the bootloader.
boot = {
# Enable secure boot.
@ -74,34 +73,29 @@ with lib;
# Exclude some default gnome applications.
environment.gnome.excludePackages = (
with pkgs;
[
epiphany
gnome-connections
gnome-console
gnome-maps
gnome-music
gnome-tour
totem
yelp
with pkgs; [
epiphany # Browser (replaced by Firefox).
gnome-connections # Remote desktop viewer.
gnome-console # Terminal (replaced by ghostTTY).
gnome-maps # Maps viewer.
gnome-music # Music player.
gnome-tour # First-boot tour.
totem # Movie player (replaced by Celluloid).
yelp # Help viewer.
]
);
# Remove NixOS HTML manual
documentation.doc.enable = false;
# Use ghostty for the "open in terminal" option in file manager.
programs.nautilus-open-any-terminal = {
enable = true;
terminal = "ghostty";
};
# Run electron apps under wayland.
environment.sessionVariables.NIXOS_OZONE_WL = "1";
# Install some packages.
programs.steam.enable = true;
programs.firefox.enable = true;
programs = {
steam.enable = true;
firefox.enable = true;
};
environment.systemPackages = with pkgs; [
adwsteamgtk
@ -109,7 +103,6 @@ with lib;
caligula
celluloid
discord
userPackages.feishin
ghostty
gimp3
glabels-qt
@ -121,14 +114,12 @@ with lib;
libreoffice
merriweather
merriweather-sans
nixd # nix language server
alejandra # nix language formatter
nerd-fonts.fira-code
obsidian
protonmail-desktop
signal-desktop
smile
vscodium
userPackages.feishin
yubioath-flutter
# PrismLauncher with temurin jre.
@ -148,12 +139,14 @@ with lib;
))
];
# Enable gamemode service
# Enable gamemode service.
programs.gamemode.enable = true;
# Enable CUPS to print documents.
services.printing.enable = true;
services.printing.drivers = [ pkgs.brlaser ];
services.printing = {
enable = true;
drivers = [pkgs.brlaser];
};
# If you don't set this Wireguard won't work.
networking.firewall.checkReversePath = false;
@ -170,6 +163,6 @@ with lib;
# Enable CPU frequency scaling management.
services.power-profiles-daemon.enable = mkForce false; # enabled by gnome
services.tlp.enable = lib.mkForce false; # enabled by nixos-hardware
services.tlp.enable = mkForce false; # enabled by nixos-hardware
services.auto-cpufreq.enable = true;
}

View file

@ -1,8 +1,4 @@
{
modulesPath,
...
}:
{
{modulesPath, ...}: {
imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix")
./server.nix

View file

@ -1,13 +1,16 @@
{ user, lib, ... }:
with lib;
{
# Passwordless sudo
user,
lib,
...
}:
with lib; {
# Passwordless sudo.
security.sudo.wheelNeedsPassword = false;
# Enable all terminfo (for ghostty)
# Enable all terminfo (for ghostty).
environment.enableAllTerminfo = true;
# Enable SSH server
# Enable SSH server.
services.openssh.enable = true;
users.users.${user} = {

View file

@ -3,8 +3,7 @@
lib,
...
}:
with lib;
{
with lib; {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
./server.nix