Compare commits
12 commits
2a4316b08a
...
3ad9e0f87a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ad9e0f87a | ||
|
|
f28d3ea99d | ||
|
|
c7d8dcbdf6 | ||
|
|
aff6ef3d99 | ||
|
|
39f2ca010f | ||
|
|
26093e6884 | ||
|
|
27ff41dff0 | ||
|
|
d51a0936ab | ||
|
|
553fb15efa | ||
|
|
0d34be0529 | ||
|
|
b95a4366a4 | ||
|
|
c272eaf158 |
40
bin/mkhost
Executable file
40
bin/mkhost
Executable file
|
|
@ -0,0 +1,40 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "usage: ${0##*/} <name>"
|
||||
exit 1
|
||||
fi
|
||||
DIR="$(dirname "$0")"
|
||||
HOST="$(realpath "$DIR/../hosts/$1")"
|
||||
USER="ahnwuoa"
|
||||
if [ -e "$HOST" ]; then
|
||||
echo "$1 already exists"
|
||||
exit 2
|
||||
fi
|
||||
mkdir "$HOST"
|
||||
nixos-generate-config --show-hardware-config > "$HOST/hardware-configuration.nix"
|
||||
cat << EOF > "$HOST/default.nix"
|
||||
{...}: {
|
||||
imports = [
|
||||
../../system
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
networking.hostName = "$1";
|
||||
time.timeZone = "America/Chicago";
|
||||
users.users.$USER = {
|
||||
isNormalUser = true;
|
||||
extraGroups = ["wheel" "podman"];
|
||||
};
|
||||
}
|
||||
EOF
|
||||
mkdir -p "$HOST/users/$USER"
|
||||
cat << EOF > "$HOST/users/$USER/default.nix"
|
||||
{...}: {
|
||||
imports = [
|
||||
../../../../user
|
||||
];
|
||||
|
||||
home.username = "$USER";
|
||||
}
|
||||
EOF
|
||||
54
flake.lock
54
flake.lock
|
|
@ -5,11 +5,11 @@
|
|||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1730504689,
|
||||
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
|
||||
"lastModified": 1733312601,
|
||||
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "506278e768c2a08bec68eb62932193e341f55c90",
|
||||
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -26,11 +26,11 @@
|
|||
"utils": "utils"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1732539262,
|
||||
"narHash": "sha256-FdVYqG37TYGC/oiXpFt8VVHTv7lCyjc3UxPaZIxvWCI=",
|
||||
"lastModified": 1734395804,
|
||||
"narHash": "sha256-m75doN+grfAo8pO2s2wwnsUwSxZGElY/Fcpo3RZ80D4=",
|
||||
"owner": "wamserma",
|
||||
"repo": "flake-programs-sqlite",
|
||||
"rev": "9355bb57fbc60103e933e081e36f9712e3b3bc66",
|
||||
"rev": "42f6a8859142dc7dcb05502015913106fc77251f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -46,11 +46,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1732482255,
|
||||
"narHash": "sha256-GUffLwzawz5WRVfWaWCg78n/HrBJrOG7QadFY6rtV8A=",
|
||||
"lastModified": 1734344598,
|
||||
"narHash": "sha256-wNX3hsScqDdqKWOO87wETUEi7a/QlPVgpC/Lh5rFOuA=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "a9953635d7f34e7358d5189751110f87e3ac17da",
|
||||
"rev": "83ecd50915a09dca928971139d3a102377a8d242",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -68,11 +68,11 @@
|
|||
"umu": "umu"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1732543374,
|
||||
"narHash": "sha256-suhk41NhdsnN3aa7gpsr8KnYJtbaLeZBJMB2vqWbkzA=",
|
||||
"lastModified": 1734313951,
|
||||
"narHash": "sha256-DCjhmX5dVn11J8Ss+5Py4yMh8k7a63HakMENccGZBr4=",
|
||||
"owner": "fufexan",
|
||||
"repo": "nix-gaming",
|
||||
"rev": "18b8f0796f3e9dd8b9d9f262a56f2914a0586a22",
|
||||
"rev": "a5f8dee3f7e6864da0d69a227bc8a90a3cbf9d0f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -83,11 +83,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1732014248,
|
||||
"narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
|
||||
"lastModified": 1734119587,
|
||||
"narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
|
||||
"rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -99,28 +99,28 @@
|
|||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1730504152,
|
||||
"narHash": "sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s=",
|
||||
"lastModified": 1733096140,
|
||||
"narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz"
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz"
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1731797254,
|
||||
"narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=",
|
||||
"lastModified": 1734083684,
|
||||
"narHash": "sha256-5fNndbndxSx5d+C/D0p/VF32xDiJCJzyOqorOYW4JEo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59",
|
||||
"rev": "314e12ba369ccdb9b352a4db26ff419f7c49fa84",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-24.05",
|
||||
"ref": "nixos-24.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
|
|
@ -143,11 +143,11 @@
|
|||
},
|
||||
"locked": {
|
||||
"dir": "packaging/nix",
|
||||
"lastModified": 1732337089,
|
||||
"narHash": "sha256-dwFza03ETqrcmVGSCdgDDKTWKRgckpQ3vXkZRCYtM9g=",
|
||||
"lastModified": 1734207213,
|
||||
"narHash": "sha256-5CZPAeKm24Y1BKnN8Md3HUViCMCs7AVghRC+05Bdlkk=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "f6a6af3191f5497d95d8f8aaa08826a45da199c4",
|
||||
"revCount": 842,
|
||||
"rev": "6189d0d9fd062e89a375db20aeae1d1c009e9833",
|
||||
"revCount": 869,
|
||||
"submodules": true,
|
||||
"type": "git",
|
||||
"url": "https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
|
|
|||
21
hosts/hebesu/default.nix
Normal file
21
hosts/hebesu/default.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
../../system
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
networking.hostName = "hebesu";
|
||||
services.tzupdate.enable = true;
|
||||
services.xserver = {
|
||||
videoDrivers = ["modesetting"];
|
||||
deviceSection = ''
|
||||
Option "DRI" "2"
|
||||
Option "TearFree" "true"
|
||||
'';
|
||||
xkb.options = "ctrl:nocaps";
|
||||
};
|
||||
users.users.ahnwuoa = {
|
||||
isNormalUser = true;
|
||||
extraGroups = ["wheel" "podman"];
|
||||
};
|
||||
}
|
||||
52
hosts/hebesu/hardware-configuration.nix
Normal file
52
hosts/hebesu/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usbhid"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/e9de5286-c8b1-4629-be01-f052c34b4062";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/home" = {
|
||||
device = "/dev/disk/by-uuid/aa592b0f-13bd-4ae6-af3f-68a8f76f65ae";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."drive".device = "/dev/disk/by-uuid/60d5cc58-4381-4869-a1b5-d4e2bf1afdfd";
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/F0F5-744F";
|
||||
fsType = "vfat";
|
||||
options = ["fmask=0022" "dmask=0022"];
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{device = "/dev/disk/by-uuid/2d015dcd-81a0-4d81-b530-5ea96aa0d953";}
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
12
hosts/hebesu/users/ahnwuoa/default.nix
Normal file
12
hosts/hebesu/users/ahnwuoa/default.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
../../../../user
|
||||
];
|
||||
|
||||
home.username = "ahnwuoa";
|
||||
xresources.properties."Xft.dpi" = 120;
|
||||
}
|
||||
|
|
@ -1,4 +1,9 @@
|
|||
{...}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
lib.mkIf config.u.has.graphical {
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
|
|
|
|||
|
|
@ -12,14 +12,13 @@
|
|||
|
||||
environment.pathsToLink = ["/libexec"];
|
||||
environment.localBinInPath = true;
|
||||
services.globalprotect.enable = true;
|
||||
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
(neovim.override {withRuby = false;})
|
||||
wget
|
||||
tree
|
||||
tmux
|
||||
|
|
@ -33,9 +32,10 @@
|
|||
documentation.dev.enable = true;
|
||||
|
||||
xdg.terminal-exec = {
|
||||
enable = true;
|
||||
enable = config.u.has.graphical;
|
||||
settings.default = ["Alacritty.desktop"];
|
||||
};
|
||||
services.globalprotect.enable = config.u.has.graphical;
|
||||
|
||||
environment.etc."ssh/ssh_config".text = lib.mkAfter "Include /home/*/.local/ssh/config";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{...}: {
|
||||
{lib, ...}: {
|
||||
imports = [
|
||||
./audio.nix
|
||||
./bash.nix
|
||||
|
|
@ -10,4 +10,28 @@
|
|||
./security.nix
|
||||
./virt.nix
|
||||
];
|
||||
options.u = {
|
||||
has = {
|
||||
graphical = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "enable graphical settings";
|
||||
default = true;
|
||||
};
|
||||
wine = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "enable wine settings";
|
||||
default = true;
|
||||
};
|
||||
virt = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "enable virt settings";
|
||||
default = true;
|
||||
};
|
||||
container = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "enable container settings";
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
lib.mkIf config.u.has.graphical {
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
autorun = false;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,15 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
i18n.supportedLocales = [
|
||||
"en_US.UTF-8/UTF-8"
|
||||
"ja_JP.UTF-8/UTF-8"
|
||||
];
|
||||
i18n.inputMethod = {
|
||||
i18n.inputMethod = lib.mkIf config.u.has.graphical {
|
||||
enable = true;
|
||||
type = "fcitx5";
|
||||
fcitx5.addons = with pkgs; [
|
||||
|
|
@ -12,11 +17,12 @@
|
|||
fcitx5-gtk
|
||||
];
|
||||
};
|
||||
fonts.packages = with pkgs; [
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
source-han-sans
|
||||
source-han-serif
|
||||
(nerdfonts.override {fonts = ["JetBrainsMono"];})
|
||||
];
|
||||
fonts.packages = with pkgs;
|
||||
lib.optionals config.u.has.graphical [
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
source-han-sans
|
||||
source-han-serif
|
||||
nerd-fonts.jetbrains-mono
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
lib.mkIf config.u.has.graphical {
|
||||
programs.partition-manager = {
|
||||
enable = true;
|
||||
package = pkgs.libsForQt5.partitionmanager;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
{...}: {
|
||||
virtualisation.containers.enable = true;
|
||||
{config, ...}: {
|
||||
virtualisation.containers.enable = config.u.has.container;
|
||||
virtualisation = {
|
||||
podman = {
|
||||
enable = true;
|
||||
enable = config.u.has.container;
|
||||
dockerCompat = true;
|
||||
defaultNetwork.settings.dns_enabled = true;
|
||||
};
|
||||
};
|
||||
virtualisation.libvirtd.enable = true;
|
||||
programs.virt-manager.enable = true;
|
||||
virtualisation.libvirtd.enable = config.u.has.virt;
|
||||
programs.virt-manager.enable = config.u.has.graphical && config.u.has.virt;
|
||||
programs.nix-ld.enable = true;
|
||||
hardware.graphics.enable32Bit = true;
|
||||
hardware.graphics.enable32Bit = config.u.has.graphical && config.u.has.wine;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,11 @@
|
|||
{pkgs, pkgs-stable, ...}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
pkgs-stable,
|
||||
...
|
||||
}:
|
||||
lib.mkIf config.u.has.graphical {
|
||||
systemd.user.targets.autostart = {
|
||||
Unit = {
|
||||
Wants = [
|
||||
|
|
@ -10,6 +17,7 @@
|
|||
"fcitx5.service"
|
||||
"picom.service"
|
||||
"safeeyes.service"
|
||||
"snixembed.service"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
@ -18,5 +26,6 @@
|
|||
fcitx5.Service.ExecStart = ["/run/current-system/sw/bin/fcitx5"];
|
||||
picom.Service.ExecStart = ["${pkgs.picom}/bin/picom"];
|
||||
safeeyes.Service.ExecStart = ["${pkgs-stable.safeeyes}/bin/safeeyes"];
|
||||
snixembed.Service.ExecStart = ["${pkgs.snixembed}/bin/snixembed"];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@
|
|||
#nsxiv-rifle = [pkgs.nsxiv];
|
||||
#screenshot = [pkgs.maim pkgs.xclip];
|
||||
};
|
||||
mkln = x: config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.local/nixos/user/bin/${x}";
|
||||
ln = config.u.lib.ln "${config.u.confPath}/user/bin";
|
||||
in {
|
||||
home.file = builtins.listToAttrs (
|
||||
map
|
||||
(x: {
|
||||
name = ".local/bin/${x}";
|
||||
value = {source = mkln x;};
|
||||
value = {source = ln x;};
|
||||
})
|
||||
(
|
||||
builtins.filter
|
||||
|
|
|
|||
|
|
@ -30,3 +30,13 @@ function goto() {
|
|||
local real="$(realpath "$path")"
|
||||
cd "${real%/*}"
|
||||
}
|
||||
function rl() {
|
||||
local l="$1"
|
||||
local i=50
|
||||
while [[ -L "$l" && $((i--)) > 0 ]]; do
|
||||
local n="$(readlink "$l")"
|
||||
echo "$l -> $n"
|
||||
l="$n"
|
||||
done
|
||||
[[ -e "$l" ]] && echo "$l" || echo "~nonexistent~"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,22 +4,21 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
mkln = x: config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.local/nixos/user/config/${x}";
|
||||
tmuxConfig = config.u.tmux.extraConfig + lib.strings.concatMapStrings (x: "\nrun ${x.rtp}") config.u.tmux.plugins;
|
||||
ln = config.u.lib.ln "${config.u.confPath}/user/config";
|
||||
in {
|
||||
imports = [./kde];
|
||||
|
||||
u.tmux.plugins = with pkgs.tmuxPlugins; [
|
||||
vim-tmux-navigator
|
||||
sessionist
|
||||
imports = [
|
||||
./kde
|
||||
./tmux
|
||||
./nvim
|
||||
];
|
||||
|
||||
fonts.fontconfig.enable = false;
|
||||
gtk.gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||
xresources.path = "${config.xdg.configHome}/Xresources";
|
||||
|
||||
xdg.configFile.alacritty.source = mkln "alacritty";
|
||||
xdg.configFile.awesome.source = mkln "awesome";
|
||||
xdg.configFile.bash.source = mkln "bash";
|
||||
xdg.configFile.alacritty.source = ln "alacritty";
|
||||
xdg.configFile.awesome.source = ln "awesome";
|
||||
xdg.configFile.bash.source = ln "bash";
|
||||
xdg.configFile.fcitx5.source = ./fcitx5;
|
||||
xdg.configFile.fontconfig.source = ./fontconfig;
|
||||
xdg.configFile."gdb/gdbinit.py".source = gdb/gdbinit.py;
|
||||
|
|
@ -35,6 +34,5 @@ in {
|
|||
xdg.configFile.qt5ct.source = ./qt5ct;
|
||||
xdg.configFile.readline.source = ./readline;
|
||||
xdg.configFile."starship.toml".source = ./starship.toml;
|
||||
xdg.configFile.sx.source = mkln "sx";
|
||||
xdg.configFile."tmux/tmux.conf".text = (builtins.readFile tmux/tmux.conf) + tmuxConfig;
|
||||
xdg.configFile.sx.source = ln "sx";
|
||||
}
|
||||
|
|
|
|||
32
user/config/nvim/default.nix
Normal file
32
user/config/nvim/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
vim-tmux-navigator
|
||||
which-key-nvim
|
||||
telescope-nvim
|
||||
nvim-treesitter.withAllGrammars
|
||||
nvim-lspconfig
|
||||
fidget-nvim
|
||||
nvim-cmp
|
||||
luasnip
|
||||
cmp_luasnip
|
||||
cmp-nvim-lsp
|
||||
mini-nvim
|
||||
vim-sleuth
|
||||
catppuccin-nvim
|
||||
tokyonight-nvim
|
||||
];
|
||||
extraPackages = with pkgs; [
|
||||
basedpyright
|
||||
clang-tools
|
||||
];
|
||||
withRuby = false;
|
||||
};
|
||||
xdg.configFile."nvim/init.lua".text = "require('init')";
|
||||
xdg.configFile."nvim/lua".source = config.u.lib.lnn "user/config/nvim/lua";
|
||||
}
|
||||
4
user/config/nvim/lua/init.lua
Normal file
4
user/config/nvim/lua/init.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
require('u.bindings')
|
||||
require('u.options')
|
||||
require('u.lsp')
|
||||
require('u.cmp')
|
||||
4
user/config/nvim/lua/u/bindings.lua
Normal file
4
user/config/nvim/lua/u/bindings.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||
|
||||
require('mini.move').setup()
|
||||
require('mini.ai').setup()
|
||||
39
user/config/nvim/lua/u/cmp.lua
Normal file
39
user/config/nvim/lua/u/cmp.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
luasnip.config.setup()
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
|
||||
['<C-y>'] = cmp.mapping.confirm { select = true },
|
||||
|
||||
['<C-Space>'] = cmp.mapping.complete {},
|
||||
|
||||
['<C-l>'] = cmp.mapping(function()
|
||||
if luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<C-h>'] = cmp.mapping(function()
|
||||
if luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
},
|
||||
completion = { completeopt = 'menu,menuone,noinsert' },
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'path' },
|
||||
},
|
||||
})
|
||||
16
user/config/nvim/lua/u/lsp.lua
Normal file
16
user/config/nvim/lua/u/lsp.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
local lspconfig = require('lspconfig')
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
|
||||
|
||||
lspconfig.clangd.setup({
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--background-index",
|
||||
"--clang-tidy",
|
||||
"--completion-style=bundled",
|
||||
"--cross-file-rename",
|
||||
"--header-insertion=iwyu",
|
||||
},
|
||||
capabilities=capabilities
|
||||
})
|
||||
lspconfig.basedpyright.setup{}
|
||||
59
user/config/nvim/lua/u/options.lua
Normal file
59
user/config/nvim/lua/u/options.lua
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
vim.g.have_nerd_font = true
|
||||
|
||||
vim.opt.number = true
|
||||
|
||||
vim.opt.mouse = 'a'
|
||||
|
||||
vim.opt.showmode = false
|
||||
|
||||
vim.schedule(function()
|
||||
vim.opt.clipboard = 'unnamedplus'
|
||||
end)
|
||||
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.expandtab = true
|
||||
|
||||
vim.opt.breakindent = true
|
||||
|
||||
vim.opt.undofile = true
|
||||
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
|
||||
vim.opt.signcolumn = 'yes'
|
||||
|
||||
vim.opt.updatetime = 250
|
||||
|
||||
vim.opt.timeoutlen = 300
|
||||
|
||||
vim.opt.splitright = true
|
||||
vim.opt.splitbelow = true
|
||||
|
||||
vim.opt.list = true
|
||||
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
||||
|
||||
vim.opt.inccommand = 'split'
|
||||
|
||||
vim.opt.cursorline = true
|
||||
|
||||
vim.opt.scrolloff = 8
|
||||
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
local statusline = require('mini.statusline')
|
||||
statusline.setup()
|
||||
statusline.section_location = function()
|
||||
return '%2l:%-2v'
|
||||
end
|
||||
vim.cmd.colorscheme 'tokyonight-storm'
|
||||
14
user/config/tmux/default.nix
Normal file
14
user/config/tmux/default.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
tmuxConfig = config.u.tmux.extraConfig + lib.strings.concatMapStrings (x: "\nrun ${x.rtp}") config.u.tmux.plugins;
|
||||
in {
|
||||
u.tmux.plugins = with pkgs.tmuxPlugins; [
|
||||
vim-tmux-navigator
|
||||
sessionist
|
||||
];
|
||||
xdg.configFile."tmux/tmux.conf".text = (builtins.readFile ./tmux.conf) + tmuxConfig;
|
||||
}
|
||||
|
|
@ -1,12 +1,20 @@
|
|||
{...}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./autostart.nix
|
||||
./bin
|
||||
./config
|
||||
./home.nix
|
||||
./fhs.nix
|
||||
./options.nix
|
||||
./packages.nix
|
||||
./prog.nix
|
||||
./share
|
||||
./theme.nix
|
||||
./xdg.nix
|
||||
];
|
||||
home.homeDirectory = lib.mkDefault "/home/${config.home.username}";
|
||||
home.stateVersion = "24.05";
|
||||
}
|
||||
|
|
|
|||
18
user/fhs.nix
Normal file
18
user/fhs.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{pkgs, ...}: let
|
||||
base = pkgs.appimageTools.defaultFhsEnvArgs;
|
||||
fhs = {
|
||||
name = "fhs";
|
||||
targetPkgs = pkgs:
|
||||
(base.targetPkgs pkgs)
|
||||
++ [
|
||||
pkgs.pkg-config
|
||||
pkgs.ncurses
|
||||
];
|
||||
profile = "export FHS=1";
|
||||
runScript = "bash";
|
||||
extraOutputsToInstall = ["dev"];
|
||||
};
|
||||
fhsenv = pkgs.buildFHSUserEnv (base // fhs);
|
||||
in {
|
||||
home.packages = [fhsenv];
|
||||
}
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
pkgs-stable,
|
||||
...
|
||||
}: {
|
||||
home.homeDirectory = lib.mkDefault "/home/${config.home.username}";
|
||||
home.packages = with pkgs; [
|
||||
(pkgs.symlinkJoin {
|
||||
name = "firefox";
|
||||
paths = [pkgs.firefox-bin];
|
||||
buildInputs = [pkgs.makeWrapper];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/firefox \
|
||||
--set HOME "${config.home.homeDirectory}/.local/home"
|
||||
'';
|
||||
})
|
||||
alacritty
|
||||
mpv
|
||||
(nsxiv.overrideAttrs {
|
||||
buildInputs = pkgs.nsxiv.buildInputs ++ [pkgs.xorg.libXcursor];
|
||||
env.NIX_LDFLAGS = "-lXcursor";
|
||||
})
|
||||
rofi
|
||||
sct
|
||||
(maim.overrideAttrs {
|
||||
buildInputs = pkgs.maim.buildInputs ++ [pkgs.xorg.libXcursor];
|
||||
env.NIX_LDFLAGS = "-lXcursor";
|
||||
})
|
||||
xclip
|
||||
copyq
|
||||
picom
|
||||
obs-studio
|
||||
screenkey
|
||||
pkgs-stable.safeeyes
|
||||
libsForQt5.kolourpaint
|
||||
libsForQt5.filelight
|
||||
papirus-icon-theme
|
||||
lightly-boehs
|
||||
pavucontrol
|
||||
qpwgraph
|
||||
qbittorrent
|
||||
xournalpp
|
||||
adwaita-icon-theme
|
||||
|
||||
lsd
|
||||
bat
|
||||
zoxide
|
||||
fd
|
||||
ripgrep
|
||||
fzf
|
||||
trash-cli
|
||||
tlrc
|
||||
speedtest-cli
|
||||
bluetuith
|
||||
unixtools.xxd
|
||||
starship
|
||||
killall
|
||||
file
|
||||
nix-tree
|
||||
alejandra
|
||||
ffmpeg
|
||||
ffsubsync
|
||||
|
||||
(python312.withPackages (python-pkgs: [
|
||||
python-pkgs.pwntools
|
||||
python-pkgs.requests
|
||||
python-pkgs.pyjwt
|
||||
python-pkgs.flask
|
||||
]))
|
||||
nodejs
|
||||
deno
|
||||
gnumake
|
||||
coq
|
||||
coqPackages.coqide
|
||||
gcc
|
||||
sqlitebrowser
|
||||
globalprotect-openconnect
|
||||
|
||||
tmuxPlugins.vim-tmux-navigator
|
||||
tmuxPlugins.sessionist
|
||||
|
||||
wine
|
||||
winetricks
|
||||
|
||||
cage
|
||||
|
||||
gdb
|
||||
pwndbg
|
||||
(pkgs-stable.cutter.withPlugins (ps: with ps; [jsdec rz-ghidra sigdb]))
|
||||
ghidra-bin
|
||||
pwninit
|
||||
patchelf
|
||||
];
|
||||
home.stateVersion = "24.05";
|
||||
}
|
||||
|
|
@ -1,5 +1,15 @@
|
|||
{lib, ...}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
options.u = {
|
||||
confPath = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = "path to nixos config";
|
||||
default = "${config.home.homeDirectory}/.local/nixos";
|
||||
};
|
||||
tmux = {
|
||||
plugins = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.package;
|
||||
|
|
@ -33,5 +43,46 @@
|
|||
});
|
||||
description = "list of file manager bookmarks";
|
||||
};
|
||||
has = {
|
||||
graphical = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "enable graphical settings";
|
||||
default = true;
|
||||
};
|
||||
wine = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "enable wine settings";
|
||||
default = true;
|
||||
};
|
||||
prog = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "enable prog settings";
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
lib = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
description = "library";
|
||||
};
|
||||
};
|
||||
config.u.lib = rec {
|
||||
ln = base: x: config.lib.file.mkOutOfStoreSymlink "${base}/${x}";
|
||||
lnh = ln "${config.home.homeDirectory}";
|
||||
lnn = ln "${config.u.confPath}";
|
||||
fixXcursor = pkg:
|
||||
pkg.overrideAttrs {
|
||||
buildInputs = pkg.buildInputs ++ [pkgs.xorg.libXcursor];
|
||||
env.NIX_LDFLAGS = "-lXcursor";
|
||||
};
|
||||
localHome = pkg: name: bin:
|
||||
pkgs.symlinkJoin {
|
||||
name = name;
|
||||
paths = [pkg];
|
||||
buildInputs = [pkgs.makeWrapper];
|
||||
postBuild = ''
|
||||
wrapProgram $out/${bin} \
|
||||
--set HOME "${config.home.homeDirectory}/.local/home"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
63
user/packages.nix
Normal file
63
user/packages.nix
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
pkgs-stable,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs;
|
||||
[
|
||||
lsd
|
||||
bat
|
||||
zoxide
|
||||
fd
|
||||
ripgrep
|
||||
fzf
|
||||
trash-cli
|
||||
tlrc
|
||||
speedtest-cli
|
||||
unixtools.xxd
|
||||
starship
|
||||
killall
|
||||
file
|
||||
nix-tree
|
||||
alejandra
|
||||
ffmpeg
|
||||
ffsubsync
|
||||
unzip
|
||||
unar
|
||||
tmuxPlugins.vim-tmux-navigator
|
||||
tmuxPlugins.sessionist
|
||||
]
|
||||
++ lib.optionals config.u.has.graphical [
|
||||
(config.u.lib.localHome pkgs.firefox-bin "firefox" "bin/firefox")
|
||||
alacritty
|
||||
mpv
|
||||
(config.u.lib.fixXcursor nsxiv)
|
||||
rofi
|
||||
sct
|
||||
(config.u.lib.fixXcursor maim)
|
||||
xclip
|
||||
copyq
|
||||
picom
|
||||
obs-studio
|
||||
screenkey
|
||||
pkgs-stable.safeeyes
|
||||
snixembed
|
||||
libsForQt5.kolourpaint
|
||||
libsForQt5.filelight
|
||||
papirus-icon-theme
|
||||
lightly-boehs
|
||||
pavucontrol
|
||||
qpwgraph
|
||||
qbittorrent
|
||||
xournalpp
|
||||
adwaita-icon-theme
|
||||
bluetuith
|
||||
globalprotect-openconnect
|
||||
]
|
||||
++ lib.optionals config.u.has.wine [
|
||||
wine
|
||||
winetricks
|
||||
];
|
||||
}
|
||||
32
user/prog.nix
Normal file
32
user/prog.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
lib.mkIf config.u.has.prog {
|
||||
home.packages = with pkgs;
|
||||
[
|
||||
(python312.withPackages (python-pkgs: [
|
||||
python-pkgs.pwntools
|
||||
python-pkgs.requests
|
||||
python-pkgs.pyjwt
|
||||
python-pkgs.flask
|
||||
]))
|
||||
nodejs
|
||||
deno
|
||||
gnumake
|
||||
coq
|
||||
coqPackages.coqide
|
||||
gcc
|
||||
gdb
|
||||
pwndbg
|
||||
pwninit
|
||||
patchelf
|
||||
]
|
||||
++ lib.optionals config.u.has.graphical [
|
||||
(cutter.withPlugins (ps: with ps; [jsdec rz-ghidra sigdb]))
|
||||
ghidra-bin
|
||||
sqlitebrowser
|
||||
];
|
||||
}
|
||||
|
|
@ -1,4 +1,9 @@
|
|||
{...}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
lib.mkIf config.u.has.graphical {
|
||||
xdg.desktopEntries."nsxiv-rifle" = {
|
||||
exec = "nsxiv-rifle %F";
|
||||
icon = "nsxiv";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
lib.mkIf config.u.has.graphical {
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme.name = "qtct";
|
||||
|
|
|
|||
16
user/xdg.nix
16
user/xdg.nix
|
|
@ -1,8 +1,10 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
lib.mkIf config.u.has.graphical {
|
||||
xdg.mimeApps.enable = true;
|
||||
xdg.mimeApps.defaultApplications = let
|
||||
image = "nsxiv-rifle.desktop";
|
||||
|
|
@ -34,12 +36,12 @@
|
|||
config.common.default = "kde";
|
||||
};
|
||||
home.file = let
|
||||
mkln = x: config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/${x}";
|
||||
ln = config.u.lib.lnh;
|
||||
in {
|
||||
".local/home/.cache".source = mkln ".cache";
|
||||
".local/home/.config".source = mkln ".config";
|
||||
".local/home/.local".source = mkln ".local";
|
||||
".local/home/Desktop".source = mkln "Desktop";
|
||||
".local/home/Downloads".source = mkln "Downloads";
|
||||
".local/home/.cache".source = ln ".cache";
|
||||
".local/home/.config".source = ln ".config";
|
||||
".local/home/.local".source = ln ".local";
|
||||
".local/home/Desktop".source = ln "Desktop";
|
||||
".local/home/Downloads".source = ln "Downloads";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue