implemented shared system constants
This commit is contained in:
parent
f23070e414
commit
57d75d1461
43 changed files with 211 additions and 150 deletions
16
flake.lock
generated
16
flake.lock
generated
|
|
@ -16,6 +16,21 @@
|
|||
"url": "https://git.lix.systems/lix-project/flake-compat.git"
|
||||
}
|
||||
},
|
||||
"flake-file": {
|
||||
"locked": {
|
||||
"lastModified": 1792905615,
|
||||
"narHash": "sha256-KdGEzlRQPHBbNPD+AChjry8eWEx0TCrGKy1Hkacj+bA=",
|
||||
"owner": "denful",
|
||||
"repo": "flake-file",
|
||||
"rev": "7b08dbc223bb1a758a515aad9653a6bf196bc772",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "denful",
|
||||
"repo": "flake-file",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
|
|
@ -149,6 +164,7 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-file": "flake-file",
|
||||
"flake-parts": "flake-parts",
|
||||
"home-manager": "home-manager",
|
||||
"import-tree": "import-tree",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
inputs = {
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
flake-file.url = "github:denful/flake-file";
|
||||
import-tree.url = "github:vic/import-tree";
|
||||
nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.zst";
|
||||
nixpkgs-unstable.url = "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1100280.3ec636362e18/nixexprs.tar.zst";
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
{
|
||||
flake.modules.nixos.base = {
|
||||
programs = {
|
||||
fish.enable = true;
|
||||
|
||||
atuin = {
|
||||
enable = true;
|
||||
settings = {
|
||||
sync_address = "https://api.atuin.sh";
|
||||
enter_accept = true;
|
||||
};
|
||||
};
|
||||
|
||||
git = {
|
||||
enable = true;
|
||||
config = {
|
||||
init.defaultBranch = "main";
|
||||
advice.defaultBranchName = false;
|
||||
gpg.format = "ssh";
|
||||
commit.gpgSign = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
flake.modules.nixos.base = {
|
||||
services = {
|
||||
fwupd.enable = true;
|
||||
locate.enable = true;
|
||||
openssh.enable = false;
|
||||
|
||||
pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
security.rtkit.enable = true;
|
||||
|
||||
# ssh-agent user service (SSH_AUTH_SOCK=%t/ssh-agent)
|
||||
programs.ssh.startAgent = true;
|
||||
};
|
||||
}
|
||||
17
modules/fish.nix
Normal file
17
modules/fish.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
flake.modules.nixos.fish = {pkgs, ...}: {
|
||||
users.defaultUserShell = pkgs.fish;
|
||||
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
shellAbbrs = {
|
||||
l = "eza --grid --all";
|
||||
ll = "eza --long --all";
|
||||
ls = "eza";
|
||||
".." = "cd ..";
|
||||
"..." = "cd ../..";
|
||||
cat = "bat";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
9
modules/flake-parts.nix
Normal file
9
modules/flake-parts.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{inputs, ...}: {
|
||||
imports = [
|
||||
inputs.flake-parts.flakeModules.modules
|
||||
inputs.flake-parts.flakeModules.easyOverlay
|
||||
inputs.flake-file.flakeModules.default
|
||||
];
|
||||
|
||||
systems = [];
|
||||
}
|
||||
5
modules/flake/outputs.nix
Normal file
5
modules/flake/outputs.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
flake-file.outputs = ''
|
||||
inputs: inputs.flake-parts.lib.mkFlake {inherit inputs;} (inputs.import-tree ./modules);
|
||||
'';
|
||||
}
|
||||
34
modules/home/primaryUser/home-packages.nix
Normal file
34
modules/home/primaryUser/home-packages.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
flake.modules.homeManager.primaryUser = {pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
# internet
|
||||
unstable.vivaldi
|
||||
proton-vpn
|
||||
# productivity
|
||||
libreoffice-fresh
|
||||
karp
|
||||
keepassxc
|
||||
pdfarranger
|
||||
# multimedia
|
||||
vlc
|
||||
haruna
|
||||
subtitlecomposer
|
||||
kid3
|
||||
# music
|
||||
furnace
|
||||
corrscope
|
||||
unstable.audacity
|
||||
# editing
|
||||
kdePackages.kdenlive
|
||||
# games
|
||||
osu-lazer-bin
|
||||
pcsx2
|
||||
ppsspp
|
||||
# wine
|
||||
(bottles.override {removeWarningPopup = true;})
|
||||
# development
|
||||
emacs
|
||||
unstable.racket
|
||||
];
|
||||
};
|
||||
}
|
||||
92
modules/home/primaryUser/programs/fastfetch.nix
Normal file
92
modules/home/primaryUser/programs/fastfetch.nix
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
{
|
||||
flake.modules.homeManager.primaryUser = {pkgs, ...}: {
|
||||
programs.fastfetch = {
|
||||
enable = true;
|
||||
settings = {
|
||||
"$schema" = "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json";
|
||||
|
||||
logo = {
|
||||
type = "small";
|
||||
padding.top = 4;
|
||||
padding.left = 3;
|
||||
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";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
23
modules/home/primaryUser/programs/git.nix
Normal file
23
modules/home/primaryUser/programs/git.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
flake.modules.homeManager.primaryUser = {config, ...}: {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
settings = {
|
||||
user.name = config.systemConstants.repositoryOwnerUsername;
|
||||
user.email = config.systemConstants.repositoryOwnerEmail;
|
||||
};
|
||||
|
||||
signing = {
|
||||
key = "${config.systemConstants.primaryUserHomeDirectory}/.ssh/id_ed25519.pub";
|
||||
format = "ssh";
|
||||
};
|
||||
|
||||
includes = [
|
||||
{
|
||||
condition = "gitdir:${config.systemConstants.primaryUserHomeDirectory}/NixOS/";
|
||||
contents.core.sshCommand = "ssh -i ${config.systemConstants.primaryUserHomeDirectory}/.ssh/id_ed25519";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
200
modules/home/primaryUser/programs/nvf.nix
Normal file
200
modules/home/primaryUser/programs/nvf.nix
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
{inputs, ...}: {
|
||||
flake.modules.homeManager.primaryUser = {pkgs, ...}: {
|
||||
imports = [inputs.nvf.homeManagerModules.default];
|
||||
|
||||
home.packages = with pkgs.unstable; [
|
||||
lazygit
|
||||
tree-sitter
|
||||
];
|
||||
|
||||
programs.nvf = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
enableManpages = true;
|
||||
|
||||
settings.vim = {
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
|
||||
syntaxHighlighting = true;
|
||||
lineNumberMode = "relNumber";
|
||||
searchCase = "smart";
|
||||
hideSearchHighlight = false;
|
||||
|
||||
terminal.toggleterm = {
|
||||
enable = true;
|
||||
mappings.open = "<c-t>";
|
||||
lazygit = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.lazygit;
|
||||
mappings.open = "<leader>gg";
|
||||
};
|
||||
};
|
||||
|
||||
clipboard = {
|
||||
enable = true;
|
||||
registers = "unnamedplus";
|
||||
providers.wl-copy.enable = true;
|
||||
};
|
||||
|
||||
options = {
|
||||
encoding = "utf-8";
|
||||
backspace = "indent,eol,start";
|
||||
history = 1000;
|
||||
mouse = "a";
|
||||
updatetime = 300;
|
||||
|
||||
ruler = true;
|
||||
cursorline = true;
|
||||
showcmd = true;
|
||||
showmode = true;
|
||||
laststatus = 1;
|
||||
wildmenu = true;
|
||||
wildmode = ["longest" "list" "full"];
|
||||
ttyfast = true;
|
||||
lazyredraw = true;
|
||||
signcolumn = "no";
|
||||
|
||||
autoindent = true;
|
||||
expandtab = true;
|
||||
smarttab = true;
|
||||
tabstop = 4;
|
||||
shiftwidth = 4;
|
||||
softtabstop = 4;
|
||||
|
||||
hlsearch = true;
|
||||
incsearch = true;
|
||||
|
||||
termguicolors = true;
|
||||
background = "dark";
|
||||
showmatch = true;
|
||||
};
|
||||
|
||||
theme = {
|
||||
enable = true;
|
||||
name = "gruvbox";
|
||||
style = "dark";
|
||||
};
|
||||
|
||||
globals.terminal_ansi_colors = [
|
||||
"#282828"
|
||||
"#cc241d"
|
||||
"#98971a"
|
||||
"#d79921"
|
||||
"#458588"
|
||||
"#b16286"
|
||||
"#689d6a"
|
||||
"#a89984"
|
||||
"#928374"
|
||||
"#fb4934"
|
||||
"#b8bb26"
|
||||
"#fabd2f"
|
||||
"#83a598"
|
||||
"#d3869b"
|
||||
"#8ec07c"
|
||||
"#ebdbb2"
|
||||
];
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "i";
|
||||
key = "<C-l>";
|
||||
action = "λ";
|
||||
desc = "inserts lambda";
|
||||
}
|
||||
];
|
||||
|
||||
languages.nix = {
|
||||
enable = true;
|
||||
treesitter.enable = true;
|
||||
lsp.enable = true;
|
||||
format.enable = false;
|
||||
extraDiagnostics.enable = false;
|
||||
};
|
||||
|
||||
utility.undotree.enable = true;
|
||||
|
||||
augroups = [
|
||||
{
|
||||
name = "my_filetype_settings";
|
||||
clear = true;
|
||||
}
|
||||
];
|
||||
|
||||
autocmds = [
|
||||
{
|
||||
event = ["FileType"];
|
||||
pattern = [
|
||||
"javascript"
|
||||
"javascriptreact"
|
||||
"typescript"
|
||||
"typescriptreact"
|
||||
"html"
|
||||
"css"
|
||||
"scss"
|
||||
"json"
|
||||
"jsonc"
|
||||
"vue"
|
||||
"svelte"
|
||||
"yaml"
|
||||
"toml"
|
||||
"markdown"
|
||||
"nix"
|
||||
"vim"
|
||||
"ruby"
|
||||
"eruby"
|
||||
"dart"
|
||||
"haskell"
|
||||
"elm"
|
||||
];
|
||||
group = "my_filetype_settings";
|
||||
desc = "2-space indent";
|
||||
command = "setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2";
|
||||
}
|
||||
{
|
||||
event = ["FileType"];
|
||||
pattern = [
|
||||
"python"
|
||||
"rust"
|
||||
"java"
|
||||
"lua"
|
||||
"c"
|
||||
"cpp"
|
||||
"cs"
|
||||
"php"
|
||||
"kotlin"
|
||||
"swift"
|
||||
"scala"
|
||||
"perl"
|
||||
];
|
||||
group = "my_filetype_settings";
|
||||
desc = "4-space indent";
|
||||
command = "setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4";
|
||||
}
|
||||
{
|
||||
event = ["FileType"];
|
||||
pattern = ["go" "gomod" "make"];
|
||||
group = "my_filetype_settings";
|
||||
desc = "hard tabs";
|
||||
command = "setlocal noexpandtab tabstop=4 shiftwidth=4 softtabstop=0";
|
||||
}
|
||||
{
|
||||
event = ["FileType"];
|
||||
pattern = ["lisp" "scheme" "clojure" "racket" "fennel"];
|
||||
group = "my_filetype_settings";
|
||||
desc = "Lisp-style indent";
|
||||
command = "setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 lisp autoindent";
|
||||
}
|
||||
];
|
||||
|
||||
luaConfigRC.my_lispwords = ''
|
||||
vim.opt.lispwords:append({
|
||||
"defun", "defmacro", "defvar", "defparameter", "defmethod",
|
||||
"define-syntax", "lambda", "let", "let*", "letrec", "flet",
|
||||
"labels", "progn", "when", "unless", "if", "cond",
|
||||
})
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
15
modules/home/primaryUser/programs/obs.nix
Normal file
15
modules/home/primaryUser/programs/obs.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
flake.modules.homeManager.primaryUser = {pkgs, ...}: {
|
||||
programs.obs-studio = {
|
||||
enable = true;
|
||||
plugins = with pkgs.obs-studio-plugins; [
|
||||
input-overlay
|
||||
droidcam-obs
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.nixos.primaryUser = {
|
||||
programs.obs-studio.enableVirtualCamera = true;
|
||||
};
|
||||
}
|
||||
19
modules/home/primaryUser/programs/starship.nix
Normal file
19
modules/home/primaryUser/programs/starship.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
flake.modules.homeManager.primaryUser = {pkgs, ...}: {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.starship;
|
||||
enableTransience = true;
|
||||
settings = {
|
||||
"$schema" = "https://starship.rs/config-schema.json";
|
||||
git_status = {
|
||||
ahead = ">";
|
||||
behind = "<";
|
||||
diverged = "<>";
|
||||
renamed = "r";
|
||||
deleted = "d";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
21
modules/home/primaryUser/programs/tmux.nix
Normal file
21
modules/home/primaryUser/programs/tmux.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
flake.modules.homeManager.primaryUser = {
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
clock24 = true;
|
||||
baseIndex = 1;
|
||||
keyMode = "vi";
|
||||
terminal = "tmux-256color";
|
||||
escapeTime = 10;
|
||||
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
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
8
modules/home/primaryUser/programs/yt-dlp.nix
Normal file
8
modules/home/primaryUser/programs/yt-dlp.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
flake.modules.homeManager.primaryUser = {pkgs, ...}: {
|
||||
programs.yt-dlp = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.yt-dlp;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -2,29 +2,27 @@
|
|||
self,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
stateVersion = "26.05"; # i don't read comments!
|
||||
in {
|
||||
flake.modules.nixos.phostron = {lib, ...}: {
|
||||
networking.hostName = "phostron";
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
|
||||
system = {inherit stateVersion;};
|
||||
}: {
|
||||
flake.modules.nixos.phostron = {config, lib, ...}: {
|
||||
networking.hostName = config.systemConstants.phostronHostname;
|
||||
nixpkgs.hostPlatform = lib.mkDefault config.systemConstants.phostronHostPlatform;
|
||||
system.stateVersion = config.systemConstants.phostronStateVersion;
|
||||
};
|
||||
|
||||
flake.modules.homeManager.coyote = {
|
||||
home = {inherit stateVersion;};
|
||||
flake.modules.homeManager.primaryUser = {config, ...}: {
|
||||
home.stateVersion = config.systemConstants.phostronStateVersion;
|
||||
};
|
||||
|
||||
flake.nixosConfigurations.phostron = inputs.nixpkgs.lib.nixosSystem {
|
||||
modules = with self.modules.nixos; [
|
||||
base
|
||||
phostron
|
||||
fish
|
||||
sddm
|
||||
kdePlasma
|
||||
homeManagerModule
|
||||
coyote
|
||||
|
||||
fish
|
||||
primaryUser
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
{inputs, ...}: {
|
||||
imports = with inputs.flake-parts.flakeModules; [
|
||||
modules
|
||||
easyOverlay
|
||||
];
|
||||
|
||||
systems = [];
|
||||
}
|
||||
18
modules/nix.nix
Normal file
18
modules/nix.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
flake.modules.nixos.base = {
|
||||
nix = {
|
||||
settings = {
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
auto-optimise-store = true;
|
||||
};
|
||||
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 14d";
|
||||
};
|
||||
|
||||
optimise.automatic = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
11
modules/nixos/audio.nix
Normal file
11
modules/nixos/audio.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
flake.modules.nixos.base = {
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
5
modules/nixos/bluetooth.nix
Normal file
5
modules/nixos/bluetooth.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
flake.modules.nixos.base = {
|
||||
hardware.bluetooth.enable = true;
|
||||
};
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue