Archived
Watch
1
0
Fork
You've already forked nixos
0

unliterated my config

This commit is contained in:
asnev 2026-09-07 03:21:32 +07:00
commit 1f978da586
Signed by: asnev
SSH key fingerprint: SHA256:8hagYq9hDUuS5clQ78FKhIoQDvg5crdkYMHX+3g7wB4

440
flake.nix
View file

@ -1,4 +1,3 @@
# flake.nix
{
description = "asnev's NixOS configuration";
@ -22,446 +21,13 @@
home-manager,
...
}: {
# flake-modules
nixosConfigurations.phostron = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
modules = [
# phostron-configuration
# nixos-configuration
({ config, lib, pkgs, inputs, ... }: {
# nixos-configuration-contents
nix.settings.experimental-features = ["nix-command" "flakes"];
nix.settings.auto-optimise-store = true;
nix.package = pkgs.lixPackageSets.stable.lix;
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [
(final: prev: {
unstable = import inputs.nixpkgs-unstable {
system = prev.stdenv.hostPlatform.system;
config.allowUnfree = true;
};
})
(final: prev: {
inherit (prev.lixPackageSets.stable)
nixpkgs-review
nix-eval-jobs
nix-fast-build
colmena;
})
];
boot = {
loader.systemd-boot.enable = true;
loader.systemd-boot.configurationLimit = 10;
loader.efi.canTouchEfiVariables = true;
loader.timeout = 2;
kernelParams = ["quiet" "rd.udev.log_level=3" "rd.systemd.show_status=auto"];
initrd.verbose = false;
consoleLogLevel = 3;
kernelPackages = pkgs.linuxPackages;
};
time.timeZone = "Asia/Jakarta";
i18n.defaultLocale = "en_GB.UTF-8";
services = {
fwupd.enable = true;
xserver.xkb.layout = "us";
locate.enable = true;
printing.enable = true;
openssh.enable = false;
pulseaudio.enable = false;
pipewire.enable = true;
pipewire.alsa.enable = true;
pipewire.alsa.support32Bit = true;
pipewire.pulse.enable = true;
};
security.rtkit.enable = true;
security.sudo.enable = false;
security.doas.enable = true;
security.doas.extraRules = [{
groups = ["wheel"];
keepEnv = true;
persist = true;
}];
environment.systemPackages = with pkgs; [
nh alejandra literate git
# system utils
firmware-updater mtr gnupg ddate testdisk tree wget btop plocate traceroute
rlwrap entr unzip ffmpeg imagemagick gnome-disk-utility
# extra (oxidised) utils
fd bat xh tlrc dysk dust hyperfine ripgrep fzf eza
];
environment.shellAliases = {
sudo = "doas";
l = "eza --grid --all";
ll = "eza --long --all";
ls = "eza --long";
".." = "cd ..";
"..." = "cd ../..";
cat = "bat"; # this line is really funny to me
};
environment.sessionVariables.XDG_DATA_DIRS = [
"${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}"
"${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}"
];
programs = {
# nixos-configuration-programs-contents
fish.enable = true;
atuin.enable = true;
atuin.settings.sync_address = "https://api.atuin.sh";
atuin.settings.enter_accept = true;
starship.enable = true;
starship.transientPrompt.enable = true;
starship.transientPrompt.left = "starship module character";
starship.settings = {
"$schema" = "https://starship.rs/config-schema.json";
git_status = {
ahead = ">";
behind = "<";
diverged = "<>";
renamed = "r";
deleted = "d";
};
character.success_symbol = "[λ](bold green)";
character.error_symbol = "[λ](bold red)";
};
git.enable = true;
git.config = {
init.defaultBranch = "main";
advice.defaultBranchName = false;
gpg.format = "ssh";
commit.gpgSign = true;
url."https://github.com/".insteadOf = ["github:"];
};
steam.enable = true;
obs-studio.enableVirtualCamera = true;
ssh.startAgent = true;
nix-ld.enable = true;
nix-ld.libraries = with pkgs; [fuse e2fsprogs];
};
fonts.packages = with pkgs; [
# GUI fonts
inter corefonts vista-fonts roboto cantarell-fonts
# fonts for i18n
noto-fonts noto-fonts-cjk-sans noto-fonts-cjk-serif noto-fonts-color-emoji
noto-fonts-monochrome-emoji unifont unifont_upper unifont-csur
# terminal fonts
nerd-fonts.iosevka
];
fonts.fontconfig.antialias = true;
fonts.fontconfig.subpixel.rgba = "rgb";
xdg.portal.enable = true;
xdg.portal.config.common.default = ["gtk"];
xdg.portal.extraPortals = with pkgs; [xdg-desktop-portal-wlr];
})
# kde-plasma-configuration
({pkgs, ...}: {
services.displayManager.sddm.enable = true;
services.desktopManager.plasma6.enable = true;
environment.systemPackages = with pkgs.kdePackages; [
kate elisa bluez-qt kalk filelight kamoso konversation kmail ktorrent
kclock
];
environment.plasma6.excludePackages = [pkgs.kdePackages.discover];
})
({ config, lib, pkgs, modulesPath, ... }: {
# phostron-hardware-configuration-contents
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
boot.initrd.availableKernelModules = ["nvme" "ehci_pci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/24fb172c-c29f-40c3-ae4d-ff652358563a";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/DFC9-994A";
fsType = "vfat";
options = ["fmask=0077" "dmask=0077"];
};
swapDevices = [{device = "/dev/disk/by-uuid/91d96247-85c3-4e0a-93a2-5632b96179b6";}];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# phostron-configuration-contents
system.stateVersion = "26.05"; # I didn't read the comment. :)
networking.hostName = "phostron";
networking.networkmanager.enable = true;
networking.firewall.enable = true;
services.printing.enable = true;
services.printing.drivers = [pkgs.epson-escpr];
hardware.bluetooth.enable = true;
hardware.sane.enable = true;
hardware.sane.extraBackends = [pkgs.epsonscan2];
services.displayManager.sddm.settings.Theme.Font = "Inter";
services.displayManager.sddm.settings.Theme.CursorSize = 18;
})
# coyote-configuration
({ pkgs, config, ... }: let
# coyote-configuration-variables
USER_ID = 1000;
KEY_FILE = "id_ed25519";
in {
# coyote-configuration-contents
users.users.coyote = {
isNormalUser = true;
description = "coyote";
extraGroups = ["wheel" "networkmanager" "lp" "scanner"];
uid = USER_ID;
};
users.defaultUserShell = pkgs.unstable.fish;
environment.sessionVariables.SSH_AUTH_SOCK = "/run/user/${builtins.toString USER_ID}/ssh-agent";
systemd.user.services.ssh-add-key = {
wantedBy = ["default.target"];
after = ["ssh-agent.service"];
serviceConfig = {
Type = "oneshot";
ExecStartPre = "${pkgs.coreutils-full}/bin/sleep 1";
ExecStart = [
"${pkgs.openssh}/bin/ssh-add ${config.users.users.coyote.home}/.ssh/${KEY_FILE}"
];
Restart = "on-failure";
RestartSec = 1;
};
};
})
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {inherit inputs;};
home-manager.users.coyote.imports = [
({ pkgs, config, lib, inputs, ... }: {
# coyote-home-manager-configuration
# coyote-home-manager-configuration-contents
home.stateVersion = "26.05"; # Nope, didn't read the comment either.
home.username = "coyote";
home.homeDirectory = "/home/coyote";
home.shell.enableShellIntegration = true;
home.packages = with pkgs; [
# TUI
tdf neocities
# productivity
libreoffice-fresh karp keepassxc pdfarranger thunderbird
# multimedia
furnace corrscope vlc haruna subtitlecomposer kid3 kdePackages.kdenlive
unstable.audacity lmms-full calf vital
# Internet
ungoogled-chromium
# games
osu-lazer-bin pcsx2 flycast hail
# emulation
(unstable.bottles.override {removeWarningPopup = true;})
# devel
unstable.racket unstable.lazygit mitscheme
];
home.file = let
mkVimAfterFtplugin = content: langs:
builtins.listToAttrs (map (lang: {
name = ".vim/after/ftplugin/${lang}.vim";
value = {text = content;};
})
langs);
tab2Vim = ''
setlocal expandtab
setlocal tabstop=2
setlocal shiftwidth=2
setlocal softtabstop=2
'';
tab4Vim = ''
setlocal expandtab
setlocal tabstop=4
setlocal shiftwidth=4
setlocal softtabstop=4
'';
tabsVim = ''
setlocal noexpandtab
setlocal tabstop=4
setlocal shiftwidth=4
setlocal softtabstop=0
'';
lispVim = ''
setlocal expandtab
setlocal tabstop=2
setlocal shiftwidth=2
setlocal softtabstop=2
setlocal lisp
setlocal autoindent
setlocal showmatch
setlocal lispwords+=defun,defmacro,defvar,defparameter,defmethod,define-syntax,lambda,let,let*,letre,flet,labels,progn,when,unless,if,cond
'';
in
lib.mkMerge [
(mkVimAfterFtplugin tab2Vim ["javascript" "typescript" "html" "css" "json" "nix" "vim"])
(mkVimAfterFtplugin tab4Vim ["python" "rust" "java" "lua" "c" "cpp" "h" "hpp"])
(mkVimAfterFtplugin tabsVim ["go" "make"])
(mkVimAfterFtplugin lispVim ["lisp" "scheme" "clojure" "racket"])
];
programs = {
# coyote-home-manager-programs
# coyote-home-manager-programs-general
tmux = {
enable = true;
clock24 = true;
baseIndex = 1;
shortcut = "a";
keyMode = "vi";
terminal = "screen-256color";
escapeTime = 0;
extraConfig = ''
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
set-option -g status-right "\"#W\""
set -ga terminal-overrides ",*:RGB"
set -g mouse on
set -g set-clipboard on
'';
};
librewolf.enable = true;
librewolf.languagePacks = ["en-GB"];
librewolf.settings = {
"privacy.resistFingerprinting" = false;
"librewolf.webgl.prompt" = false;
"identity.fxaccounts.enabled" = true;
"middlemouse.paste" = false;
"general.autoScroll" = true;
"browser.discovery.containers.enabled" = false;
};
yt-dlp.enable = true;
yt-dlp.package = pkgs.unstable.yt-dlp;
starship.package = pkgs.unstable.starship;
obs-studio.enable = true;
obs-studio.plugins = with pkgs.obs-studio-plugins; [
input-overlay droidcam-obs wlrobs
];
# coyote-home-manager-programs-vim
vim.enable = true;
vim.packageConfigurable = pkgs.unstable.vim-full;
vim.defaultEditor = true;
vim.plugins = let
literate-vim = pkgs.vimUtils.buildVimPlugin {
name = "literate.vim";
src = pkgs.fetchFromGitHub {
owner = "zyedidia";
repo = "literate.vim";
rev = "4ffd45cb1657b67f4ed0eb639478a69209ec1f94";
sha256 = "sha256-X5iJyjeLBkKh4tUoDG8VDO6DwYVOI9DpRqpic8NinwA=";
};
};
in
with pkgs.unstable.vimPlugins; [
gruvbox rainbow literate-vim undotree
];
vim.extraConfig = ''
set nocompatible
set encoding=utf-8
set backspace=indent,eol,start
set clipboard=unnamedplus
set mouse=a
set history=1000
set updatetime=300
syntax on
set ruler
set showcmd
set showmode
set laststatus=1
set wildmenu
set wildmode=longest,list,full
set ttyfast
set lazyredraw
filetype plugin indent on
set autoindent
set smartindent
set expandtab
set smarttab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set hlsearch
set incsearch
set ignorecase
set smartcase
inoremap <C-l> λ
set termguicolors
set background=dark
colorscheme gruvbox
let g:terminal_ansi_colors = ['#282828', '#cc241d', '#98971a', '#d79921', '#458588', '#b16286', '#689d6a', '#a89984', '#928374', '#fb4934', '#b8bb26', '#fabd2f', '#83a598', '#d3869b', '#8ec07c', '#ebdbb2']
let g:rainbow_active = 1
'';
# coyote-home-manager-programs-fastfetch
fastfetch.enable = true;
fastfetch.settings = {
"$schema" = "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json";
logo.type = "small";
logo.padding.top = 4;
logo.padding.left = 3;
logo.padding.right = 4;
display.separator = " ";
modules = [
{key = "╭─────────╮"; type = "custom";}
{key = "│ {#31}user {#keys}│"; type = "title"; format = "{user-name}";}
{key = "│ {#32}host {#keys}│"; type = "title"; format = "{host-name}";}
{key = "│ {#33}uptime {#keys}│"; type = "uptime";}
{key = "│ {#34}distro {#keys}│"; type = "os";}
{key = "│ {#35}kernel {#keys}│"; type = "kernel";}
{key = "│ {#36}desktop {#keys}│"; type = "de";}
{key = "│ {#31}term {#keys}│"; type = "terminal";}
{key = "│ {#32}shell {#keys}│"; type = "shell";}
{key = "│ {#33}cpu {#keys}│"; type = "cpu"; showPeCoreCount = true;}
{key = "│ {#34}disk {#keys}│"; type = "disk"; folders = "/";}
{key = "│ {#35}memory {#keys}│"; type = "memory";}
{key = "│ {#36}network {#keys}│"; type = "localip"; format = "{ipv4} ({ifname})";}
{key = "├─────────┤"; type = "custom";}
{key = "│ {#39}colors {#keys}│"; type = "colors"; symbol = "circle";}
{key = "╰─────────╯"; type = "custom";}
];
};
};
})
];
}
./hosts/phostron
./modules/users/coyote
./modules/users/coyote/home-manager-module.nix
];
};
};
}