chore: push to github

This commit is contained in:
valerie 2024-06-28 23:40:00 -04:00
commit 8dc73bf5fc
Signed by: valnyx
GPG key ID: CC10324DD962CB7E
32 changed files with 2559 additions and 0 deletions

3
.gitignore vendored Executable file
View file

@ -0,0 +1,3 @@
.direnv
.vscode
todo.md

93
disko.nix Normal file
View file

@ -0,0 +1,93 @@
# sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko /tmp/disko.nix
# nixos-generate-config --no-filesystems --root /mnt
# mv /tmp/disko.nix /mnt/etc/nixos
# REMOVE: https://www.youtube.com/watch?v=nLwbNhSxLd4 (Full NixOS Guide)
# REMOVE: https://www.youtube.com/watch?v=YPKwkWtK7l0
# IMPORTANT: this disk configuration is setup for *impermanance* systems.
# to get rid of impermanance support, simply remove the "/persist" btrfs subvolume.
# to import, add this to the imports list:
# (import ./disko.nix { device = "/dev/?" })
{device ? throw "Set this to your disk device, e.g. /dev/sda", ...}: {
disko.devices = {
disk = {
main = {
inherit device;
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "1M";
type = "EF02";
};
ESP = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
passwordFile = "/tmp/secret.key";
settings = {
allowDiscards = true;
};
content = {
type = "lvm_pv";
vg = "root_vg";
};
};
};
swap = {
size = "35G";
content = {
type = "swap";
resumeDevice = true;
};
};
};
};
};
};
lvm_vg = {
root_vg = {
type = "lvm_vg";
lvs = {
root = {
size = "100%FREE";
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = ["compress=zstd" "noatime"];
};
"/home" = {
mountpoint = "/home";
mountOptions = ["compress=zstd" "noatime"];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = ["compress=zstd" "noatime"];
};
"/persist" = {
mountpoint = "/persist";
mountOptions = ["compress=zstd" "noatime"];
};
};
};
};
};
};
};
};
}

573
flake.lock Normal file
View file

@ -0,0 +1,573 @@
{
"nodes": {
"base16": {
"inputs": {
"fromYaml": "fromYaml"
},
"locked": {
"lastModified": 1708890466,
"narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=",
"owner": "SenchoPens",
"repo": "base16.nix",
"rev": "665b3c6748534eb766c777298721cece9453fdae",
"type": "github"
},
"original": {
"owner": "SenchoPens",
"repo": "base16.nix",
"type": "github"
}
},
"base16-fish": {
"flake": false,
"locked": {
"lastModified": 1622559957,
"narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=",
"owner": "tomyun",
"repo": "base16-fish",
"rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe",
"type": "github"
},
"original": {
"owner": "tomyun",
"repo": "base16-fish",
"type": "github"
}
},
"base16-foot": {
"flake": false,
"locked": {
"lastModified": 1696725948,
"narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=",
"owner": "tinted-theming",
"repo": "base16-foot",
"rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-foot",
"type": "github"
}
},
"base16-helix": {
"flake": false,
"locked": {
"lastModified": 1696727917,
"narHash": "sha256-FVrbPk+NtMra0jtlC5oxyNchbm8FosmvXIatkRbYy1g=",
"owner": "tinted-theming",
"repo": "base16-helix",
"rev": "dbe1480d99fe80f08df7970e471fac24c05f2ddb",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-helix",
"type": "github"
}
},
"base16-kitty": {
"flake": false,
"locked": {
"lastModified": 1665001328,
"narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=",
"owner": "kdrag0n",
"repo": "base16-kitty",
"rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805",
"type": "github"
},
"original": {
"owner": "kdrag0n",
"repo": "base16-kitty",
"type": "github"
}
},
"base16-tmux": {
"flake": false,
"locked": {
"lastModified": 1696725902,
"narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=",
"owner": "tinted-theming",
"repo": "base16-tmux",
"rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-tmux",
"type": "github"
}
},
"base16-vim": {
"flake": false,
"locked": {
"lastModified": 1716150083,
"narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=",
"owner": "tinted-theming",
"repo": "base16-vim",
"rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "base16-vim",
"type": "github"
}
},
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1719582740,
"narHash": "sha256-s4WsLu2L8EzF5Hg2TkelFLVhKGL108AySnlw8voPe5U=",
"owner": "nix-community",
"repo": "disko",
"rev": "115311bc395f24c1b553338fec4b3aa28cbf5ae2",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"fromYaml": {
"flake": false,
"locked": {
"lastModified": 1689549921,
"narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=",
"owner": "SenchoPens",
"repo": "fromYaml",
"rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84",
"type": "github"
},
"original": {
"owner": "SenchoPens",
"repo": "fromYaml",
"type": "github"
}
},
"gnome-shell": {
"flake": false,
"locked": {
"lastModified": 1713702291,
"narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=",
"owner": "GNOME",
"repo": "gnome-shell",
"rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934",
"type": "github"
},
"original": {
"owner": "GNOME",
"ref": "46.1",
"repo": "gnome-shell",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1719588253,
"narHash": "sha256-A03i8xiVgP14DCmV5P7VUv37eodCjY4e1iai0b2EuuM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "7e68e55d2e16d3a1e92a679430728c35a30fd24e",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"stylix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1715930644,
"narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"hyprcursor": {
"inputs": {
"hyprlang": [
"hyprland",
"hyprlang"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1718450675,
"narHash": "sha256-jpsns6buS4bK+1sF8sL8AaixAiCRjA+nldTKvcwmvUs=",
"owner": "hyprwm",
"repo": "hyprcursor",
"rev": "66d5b46ff94efbfa6fa3d1d1b66735f1779c34a6",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprcursor",
"type": "github"
}
},
"hyprland": {
"inputs": {
"hyprcursor": "hyprcursor",
"hyprlang": "hyprlang",
"hyprutils": "hyprutils",
"hyprwayland-scanner": "hyprwayland-scanner",
"nixpkgs": "nixpkgs",
"systems": "systems",
"xdph": "xdph"
},
"locked": {
"lastModified": 1719613382,
"narHash": "sha256-DAWdnk0cCFbOZrdo9Ku0kbrlpv7pjnF+DQBnLiyuSSQ=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "9c5dd59d4b1927b7d88e8e3c2e260eb01d95794b",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "Hyprland",
"type": "github"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
"hyprland",
"xdph",
"nixpkgs"
],
"systems": [
"hyprland",
"xdph",
"systems"
]
},
"locked": {
"lastModified": 1714869498,
"narHash": "sha256-vbLVOWvQqo4n1yvkg/Q70VTlPbMmTiCQfNTgcWDCfJM=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "e06482e0e611130cd1929f75e8c1cf679e57d161",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"hyprlang": {
"inputs": {
"hyprutils": [
"hyprland",
"hyprutils"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1717881852,
"narHash": "sha256-XeeVoKHQgfKuXoP6q90sUqKyl7EYy3ol2dVZGM+Jj94=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "ec6938c66253429192274d612912649a0cfe4d28",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"hyprutils": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1719316102,
"narHash": "sha256-dmRz128j/lJmMuTYeCYPfSBRHHQO3VeH4PbmoyAhHzw=",
"owner": "hyprwm",
"repo": "hyprutils",
"rev": "1f6bbec5954f623ff8d68e567bddcce97cd2f085",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprutils",
"type": "github"
}
},
"hyprwayland-scanner": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1719067853,
"narHash": "sha256-mAnZG/eQy72Fp1ImGtqCgUrDumnR1rMZv2E/zgP4U74=",
"owner": "hyprwm",
"repo": "hyprwayland-scanner",
"rev": "914f083741e694092ee60a39d31f693d0a6dc734",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprwayland-scanner",
"type": "github"
}
},
"impermanence": {
"locked": {
"lastModified": 1719091691,
"narHash": "sha256-AxaLX5cBEcGtE02PeGsfscSb/fWMnyS7zMWBXQWDKbE=",
"owner": "nix-community",
"repo": "impermanence",
"rev": "23c1f06316b67cb5dabdfe2973da3785cfe9c34a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "impermanence",
"type": "github"
}
},
"nh": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1718355099,
"narHash": "sha256-o4K6QHBjXrmcYkX9MIw9gZ+DHM3OaEVswswHRX9h8Is=",
"owner": "viperML",
"repo": "nh",
"rev": "6fb30a4d490a98d08628ed93a90a9d23820ef9c8",
"type": "github"
},
"original": {
"owner": "viperML",
"repo": "nh",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1719075281,
"narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a71e967ef3694799d0c418c98332f7ff4cc5f6af",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1719254875,
"narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1719426051,
"narHash": "sha256-yJL9VYQhaRM7xs0M867ZFxwaONB9T2Q4LnGo1WovuR4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "89c49874fb15f4124bf71ca5f42a04f2ee5825fd",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1714912032,
"narHash": "sha256-clkcOIkg8G4xuJh+1onLG4HPMpbtzdLv4rHxFzgsH9c=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ee4a6e0f566fe5ec79968c57a9c2c3c25f2cf41d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"disko": "disko",
"home-manager": "home-manager",
"hyprland": "hyprland",
"impermanence": "impermanence",
"nh": "nh",
"nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable",
"stylix": "stylix"
}
},
"stylix": {
"inputs": {
"base16": "base16",
"base16-fish": "base16-fish",
"base16-foot": "base16-foot",
"base16-helix": "base16-helix",
"base16-kitty": "base16-kitty",
"base16-tmux": "base16-tmux",
"base16-vim": "base16-vim",
"flake-compat": "flake-compat",
"gnome-shell": "gnome-shell",
"home-manager": "home-manager_2",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1719525570,
"narHash": "sha256-xSO/H67GAHEW0siD2PHoO/e97MbROL3r3s5SpF6A6Dc=",
"owner": "danth",
"repo": "stylix",
"rev": "1ff9d37d27377bfe8994c24a8d6c6c1734ffa116",
"type": "github"
},
"original": {
"owner": "danth",
"repo": "stylix",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"xdph": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
"hyprlang": [
"hyprland",
"hyprlang"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1718619174,
"narHash": "sha256-FWW68AVYmB91ZDQnhLMBNCUUTCjb1ZpO2k2KIytHtkA=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "c7894aa54f9a7dbd16df5cd24d420c8af22d5623",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

106
flake.nix Normal file
View file

@ -0,0 +1,106 @@
{
description = "nixos system configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence = {
url = "github:nix-community/impermanence";
};
hyprland.url = "github:hyprwm/Hyprland";
nh = {
url = "github:viperML/nh";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix.url = "github:danth/stylix";
};
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
home-manager,
...
} @ inputs: let
inherit (self) outputs;
systems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in {
# Your custom packages
# Accessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
# Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
apps = forAllSystems (system: {
"clone" = {
type = "app";
program = self.outputs.packages.${system}.clone;
};
"disko" = {
type = "app";
program = self.outputs.packages.${system}.disko;
};
});
# Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;};
# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
# nixosModules = import ./modules/nixos;
# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
# homeManagerModules = import ./modules/home-manager;
nixosConfigurations.waves = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs;
};
modules = [
inputs.disko.nixosModules.default
(import ./disko.nix {device = "/dev/nvme1n1";})
{networking.hostName = "waves";}
./os
./waves-hardware.nix
./user/users.nix
inputs.impermanence.nixosModules.impermanence
inputs.stylix.nixosModules.stylix
./os/styling.nix
];
};
homeConfigurations.deva = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home.nix
./user/desktop
./user/dev
./user/shell/zsh.nix
./user/services.nix
./user/apps
];
};
};
}

47
home.nix Normal file
View file

@ -0,0 +1,47 @@
{
config,
pkgs,
inputs,
outputs,
...
}: {
home = {
username = "deva";
homeDirectory = "/home/deva";
extraOutputsToInstall = ["doc" "devdoc"];
packages = [
inputs.nh.packages.x86_64-linux.default
];
sessionVariables = {
NIX_AUTO_RUN = "1";
FLAKE = "${config.home.homeDirectory}/nix";
};
};
nix.package = pkgs.nixVersions.latest;
nixpkgs = {
overlays = [
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
];
config = {
allowUnfree = true;
};
};
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
manual = {
html.enable = true;
json.enable = false;
manpages.enable = false;
};
programs.home-manager.enable = true;
programs.git.enable = true;
systemd.user.startServices = "sd-switch";
home.stateVersion = "24.05";
}

20
license Executable file
View file

@ -0,0 +1,20 @@
zlib License
(C) 2024 devawaves
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

22
os/btrfs-impermanence Normal file
View file

@ -0,0 +1,22 @@
mkdir /btrfs_tmp
mount /dev/root_vg/root /btrfs_tmp
if [[ -e /btrfs_tmp/root ]]; then
mkdir -p /btrfs_tmp/old_roots
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
mv /btrfs_tmp/root /btrfs_tmp/old_roots/$timestamp
fi
delete_subvolume_recursively() {
IFS=$'\n'
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
delete_subvolume_recursively "/btrfs_tmp/$i"
done
btrfs subvolume delete "$1"
}
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
delete_subvolume_recursively "$i"
done
btrfs subvolume create /btrfs_tmp/root
umount /btrfs_tmp

154
os/default.nix Normal file
View file

@ -0,0 +1,154 @@
{
config,
lib,
pkgs,
outputs,
inputs,
...
}: {
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
];
environment.systemPackages = with pkgs; [
neovim
firefox
];
nix = let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in {
settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Opinionated: disable global registry
flake-registry = "";
# Workaround for https://github.com/NixOS/nix/issues/9574
nix-path = config.nix.nixPath;
};
# Opinionated: disable channels
channel.enable = false;
# Opinionated: make flake registry and nix path match flake inputs
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
};
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.initrd.postDeviceCommands = lib.mkAfter (builtins.readFile ./btrfs-impermanence);
fileSystems."/persist".neededForBoot = true;
environment.persistence."/persist/system" = {
hideMounts = true;
directories = [
"/etc/nixos"
"/var/log"
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/etc/NetworkManager/system-connections"
{
directory = "/var/lib/colord";
user = "colord";
group = "colord";
mode = "u=rwx,g=rx,o=";
}
];
files = [
"/etc/machine-id"
];
};
networking.networkmanager.enable = true;
time.timeZone = "America/Indiana/Indianapolis";
i18n.defaultLocale = "en_US.UTF-8";
console = {
earlySetup = true;
font = "${pkgs.terminus_font}/share/consolefonts/ter-v32n.psf.gz";
keyMap = lib.mkForce "us";
useXkbConfig = true; # use xkb.options in tty.
};
environment.pathsToLink = ["/share/zsh"];
programs = {
less.enable = true;
# default zsh config
zsh = {
enable = true;
enableCompletion = true;
autosuggestions.enable = true;
promptInit = ''
PS1='%B%1~%b %(#.#.$): '
'';
};
};
boot.supportedFilesystems = ["ntfs"];
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
pulse.enable = true;
};
services.libinput.enable = true;
services.printing.enable = true;
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
services.xserver.enable = true;
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
fonts = {
enableDefaultPackages = false;
fontconfig = {
enable = true;
antialias = true;
defaultFonts = {
emoji = ["Noto Color Emoji"];
monospace = ["Cascadia Code" "Symbols Nerd Font" "Noto Color Emoji"];
serif = ["Noto Serif" "Noto Color Emoji"];
sansSerif = ["Overpass" "Nunito" "Noto Color Emoji"];
};
hinting = {
enable = true;
autohint = false;
style = "full";
};
subpixel = {
lcdfilter = "default";
rgba = "rgb";
};
};
fontDir = {
enable = true;
decompressFonts = true;
};
packages = [
pkgs.noto-fonts
pkgs.noto-fonts-emoji
pkgs.material-design-icons
(pkgs.google-fonts.override {fonts = ["Overpass" "Nunito"];})
(pkgs.nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
];
};
}

26
os/styling.nix Normal file
View file

@ -0,0 +1,26 @@
{pkgs, ...}: {
stylix.base16Scheme = {
# oxocarbon dark
base00 = "161616";
base01 = "262626";
base02 = "393939";
base03 = "525252";
base04 = "dde1e6";
base05 = "f2f4f8";
base06 = "ffffff";
base07 = "08bdba";
base08 = "3ddbd9";
base09 = "78a9ff";
base0A = "ee5396";
base0B = "33b1ff";
base0C = "ff7eb6";
base0D = "42be65";
base0E = "be95ff";
base0F = "82cfff";
};
stylix.image = ./nix-wallpaper.png;
stylix.cursor.package = pkgs.graphite-cursors;
stylix.cursor.name = "graphite-dark";
}

28
overlays/default.nix Normal file
View file

@ -0,0 +1,28 @@
{inputs, ...}: {
# This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs final.pkgs;
# This one contains whatever you want to overlay
# You can change versions, add patches, set compilation flags, anything really.
# https://nixos.wiki/wiki/Overlays
modifications = final: prev: {
# example = prev.example.overrideAttrs (oldAttrs: rec {
# ...
# });
tmuxPlugins = prev.tmuxPlugins.extend (final': prev': {
tokyo-night-tmux = prev.callPackage ../pkgs/tmux-tokyo-night.nix {
prev = prev;
lib = prev.lib;
};
});
};
# When applied, the unstable nixpkgs set (declared in the flake inputs) will
# be accessible through 'pkgs.unstable'
unstable-packages = final: _prev: {
unstable = import inputs.nixpkgs-unstable {
system = final.system;
config.allowUnfree = true;
};
};
}

5
pkgs/clone.nix Normal file
View file

@ -0,0 +1,5 @@
{pkgs}:
pkgs.writeShellScriptBin "clone" ''
CLONE_LOCATION=''${1=$HOME/nix}
${pkgs.git}/bin/git clone https://github.com/devawaves/nixos $CLONE_LOCATION
''

4
pkgs/default.nix Normal file
View file

@ -0,0 +1,4 @@
pkgs: {
clone = pkgs.callPackage ./clone.nix {};
disko = pkgs.callPackage ./disko.nix {};
}

4
pkgs/disko.nix Normal file
View file

@ -0,0 +1,4 @@
{pkgs}:
pkgs.writeShellScriptBin "disko" ''
${pkgs.curl}/bin/curl "https://raw.githubusercontent.com/devawaves/nixos/main/disko.nix" -o disko.nix
''

22
pkgs/tmux-tokyo-night.nix Normal file
View file

@ -0,0 +1,22 @@
# USED IN OVERLAY
{
prev,
lib,
}:
prev.tmuxPlugins.mkTmuxPlugin {
pluginName = "tokyo-night-tmux";
version = "c3bc283cceeefaa7e5896878fe20711f466ab591";
src = fetchFromGithub {
owner = "janoamaral";
repo = "tokyo-night-tmux";
rev = "c3bc283cceeefaa7e5896878fe20711f466ab591";
hash = "sha256-3rMYYzzSS2jaAMLjcQoKreE0oo4VWF9dZgDtABCUOtY=";
};
rtpFilePath = "tokyo-night.tmux";
meta = {
homepage = "https://github.com/janoamaral/tokyo-night-tmux";
description = "tokyo night tmux theme";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
};
}

29
readme.md Executable file
View file

@ -0,0 +1,29 @@
[![built with nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org)
<h1 align="center">deva's nixos flake</h1>
<br>
<p align="center">
<img src="https://img.shields.io/github/license/devawaves/nixos" alt="License Badge"/>
</p>
<br>
**my configuration. it changes over time like an adapting parasite.**
to explore the flake output and it's functionalities, run:
```sh
nix flake show github:devawaves/flake
```
to clone to an existing nixos system, run:
```sh
nix run github:devawaves/nixos#clone
```
to get the disko, run:
```sh
nix run github:devawaves/nixos#disko
```

12
user/apps/default.nix Normal file
View file

@ -0,0 +1,12 @@
{pkgs, ...}: {
home.packages = with pkgs; [
nom
pinta
vesktop
signal-desktop
vesktop
blockbench
blender
prismlauncher
];
}

8
user/apps/obs.nix Normal file
View file

@ -0,0 +1,8 @@
{pkgs, ...}: {
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
wlrobs
];
};
}

30
user/desktop/default.nix Normal file
View file

@ -0,0 +1,30 @@
{
pkgs,
config,
...
}: {
imports = [
./gnome.nix
];
home.packages = [
pkgs.noto-fonts
pkgs.noto-fonts-emoji
pkgs.material-design-icons
(pkgs.google-fonts.override {fonts = ["Overpass" "Nunito"];})
(pkgs.nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
];
home.pointerCursor = {
package = pkgs.graphite-cursors;
name = "graphite-dark";
size = 24;
gtk.enable = true;
x11.enable = true;
};
home.sessionVariables = {
XCURSOR_SIZE = config.home.pointerCursor.size;
XCURSOR_THEME = config.home.pointerCursor.name;
};
}

124
user/desktop/gnome.nix Normal file
View file

@ -0,0 +1,124 @@
{
pkgs,
config,
...
}: {
dconf = {
enable = true;
settings = {
"org/gnome/shell" = {
disable-user-extensions = false;
enabled-extensions = [
"user-theme@gnome-shell-extensions.gcampax.github.com"
"unite@hardpixel.eu"
];
};
"org/gnome/shell/extensions/user-theme" = {
name = "Materia-dark";
};
"org/gnome/shell/extensions/unite" = {
desktop-name-text = "Desktop";
greyscale-tray-icons = true;
hide-activities-button = "always";
hide-window-titlebars = "always";
show-window-buttons = "always";
show-window-title = "tiled";
window-buttons-placement = "first";
window-buttons-theme = "arc";
};
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
"org/gnome/desktop/wm/preferences" = {
resize-with-right-button = true;
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
binding = "<Super>Return";
command = "kitty";
name = "Open Terminal";
};
"org/gnome/settings-daemon/plugins/media-keys" = {
custom-keybindings = [
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/"
];
};
"org/gnome/desktop/background" = {
picture-uri = "file:///${./wallpaper.jpg}";
picture-uri-dark = "file:///${./nix-wallpaper.png}";
};
};
};
home.packages = with pkgs; [
# Gnome extensions
gnomeExtensions.unite
gnomeExtensions.user-themes
# Theme
materia-theme
];
gtk = {
enable = true;
font = {
name = "Iosevka";
size = 12;
};
iconTheme = {
name = "Zafiro-icons-Dark";
package = pkgs.zafiro-icons;
};
theme = {
name = "Materia-dark";
package = pkgs.materia-theme;
};
gtk2 = {
configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
extraConfig = ''
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintfull"
gtk-xft-rgba="rgb"
'';
};
gtk3 = {
bookmarks = [
"file://${config.home.homeDirectory}/Documents"
"file://${config.home.homeDirectory}/Downloads"
"file://${config.home.homeDirectory}/Music"
"file://${config.home.homeDirectory}/Pictures"
"file://${config.home.homeDirectory}/Videos"
];
extraConfig = {
gtk-application-prefer-dark-theme = 1;
gtk-xft-antialias = 1;
gtk-xft-hinting = 1;
gtk-xft-hintstyle = "hintfull";
gtk-xft-rgba = "rgb";
};
};
gtk4.extraConfig.gtk-application-prefer-dark-theme = 1;
};
home = {
sessionVariables = {
GTK_THEME = config.gtk.theme.name;
};
};
}

BIN
user/desktop/nix-wallpaper.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

BIN
user/desktop/wallpaper.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

257
user/dev/default.nix Normal file
View file

@ -0,0 +1,257 @@
{
config,
pkgs,
...
}: {
home.packages = with pkgs.unstable; [
bruno
just
nil
alejandra
zoxide
neovide
nodejs
corepack
jetbrains.idea-community
vscode
cascadia-code
];
programs = {
wezterm = {
enable = true;
extraConfig = builtins.readFile ./wezterm.lua;
colorSchemes = {
oxocarbon-dark = builtins.fromTOML (builtins.readFile (pkgs.fetchFromGitHub {
owner = "nyoom-engineering";
repo = "oxocarbon-wezterm";
rev = "b435c308403816db6fec6b87370223e8e8fbb6f4";
hash = "sha256-KsAoWQVWBHbmimw3Z9kj9j1wnFdLquzi64WP5mEjRzo=";
}
+ "/oxocarbon-dark.toml"));
};
};
lf = {
enable = true;
commands = {
dragon-out = ''%${pkgs.xdragon}/bin/xdragon -a -x "$fx"'';
editor-open = ''$$EDITOR $f'';
mkdir = ''
''${{
printf "Directory Name: "
read DIR
mkdir $DIR
}}
'';
};
keybindings = {
"\\\"" = "";
o = "";
c = "mkdir";
D = ''$rm -fr "$fx"'';
"." = "set hidden!";
"`" = "mark-load";
"\\'" = "mark-load";
"<enter>" = "open";
do = "dragon-out";
"g~" = "cd";
gh = "cd";
"g/" = "/";
ee = "editor-open";
V = ''''$${pkgs.bat}/bin/bat --paging=always --theme=gruvbox "$f"'';
};
settings = {
preview = true;
hidden = true;
drawbox = true;
icons = true;
ignorecase = true;
};
extraConfig = let
previewer = pkgs.writeShellScriptBin "pv.sh" ''
file=$1
w=$2
h=$3
x=$4
y=$5
if [[ "$( ${pkgs.file}/bin/file -Lb --mime-type "$file")" =~ ^image ]]; then
# ${pkgs.kitty}/bin/kitty +kitten icat --silent --stdin no --transfer-mode file --place "''${w}x''${h}@''${x}x''${y}" "$file" < /dev/null > /dev/tty
exit 1
fi
${pkgs.pistol}/bin/pistol "$file"
'';
cleaner = pkgs.writeShellScriptBin "clean.sh" ''
# ${pkgs.kitty}/bin/kitty +kitten icat --clear --stdin no --silent --transfer-mode file < /dev/null > /dev/tty
'';
in ''
set cleaner ${cleaner}/bin/clean.sh
set previewer ${previewer}/bin/pv.sh
'';
};
ssh = {
enable = true;
matchBlocks = {
"hi@dessa.dev" = {
host = "gitlab.com github.com";
identitiesOnly = true;
identityFile = [
"~/.ssh/id_dev"
];
};
"dess_key" = {
host = "192.168.1.203";
identitiesOnly = true;
identityFile = ["~/.ssh/id_dess"];
};
};
};
gpg = {
enable = true;
homedir = "${config.home.homeDirectory}/.gnupg";
settings = {
use-agent = true;
default-key = "CC10324DD962CB7E";
};
};
git = {
enable = true;
package = pkgs.gitAndTools.gitFull;
lfs.enable = true;
userName = "deva";
userEmail = "hi@dessa.dev";
signing = {
key = "CC10324DD962CB7E";
signByDefault = true;
};
aliases = {
lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --";
lgb = "--no-pager log --oneline --decorate --graph --parents --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --";
nuke = "!git clean -xdf && git reset --hard && git pull";
st = "status -sb";
sync = "!git push && git pull";
rs = "restore --staged";
ll = "log --oneline";
last = "log -1 HEAD --stat";
cm = "commit -m";
co = "checkout";
rv = "remote -v";
df = "diff HEAD";
};
extraConfig = {
init.defaultBranch = "main";
branch.autosetupmerge = "true";
push.default = "current";
merge.stat = "true";
core.whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol";
repack.usedeltabaseoffset = "true";
pull.ff = "only";
rebase = {
autoSquash = true;
autoStash = true;
};
rerere = {
enabled = true;
autoupdate = true;
};
};
ignores = [
"*~"
"*.swp"
"*result*"
".direnv"
"todo.md"
"node_modules"
];
};
gh = {
enable = true;
settings = {
editor = "nvim";
git_protocol = "ssh";
aliases = {
co = "pr checkout";
rc = "repo clone";
};
};
};
tmux = {
mouse = true;
prefix = "C-Space";
keyMode = "vi";
baseIndex = 1;
plugins = with pkgs.tmuxPlugins; [
vim-tmux-navigator
yank
{
plugin = mkTmuxPlugin {
pluginName = "tokyo-night-tmux";
version = "c3bc283cceeefaa7e5896878fe20711f466ab591";
src = fetchFromGithub {
owner = "janoamaral";
repo = "tokyo-night-tmux";
rev = "c3bc283cceeefaa7e5896878fe20711f466ab591";
hash = "sha256-3rMYYzzSS2jaAMLjcQoKreE0oo4VWF9dZgDtABCUOtY=";
};
rtpFilePath = "tokyo-night.tmux";
meta = {
homepage = "https://github.com/janoamaral/tokyo-night-tmux";
description = "tokyo night tmux theme";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
};
};
extraConfig = ''
set -g @tokyo-night-tmux_show_datetime 0
set -g @tokyo-night-tmux_show_path 1
set -g @tokyo-night-tmux_path_format relative
set -g @tokyo-night-tmux_window_id_style dsquare
set -g @tokyo-night-tmux_window_id_style dsquare
set -g @tokyo-night-tmux_show_git 0
'';
}
];
extraConfig = ''
set-option -sa terminal-overrides ",xterm*:Tc"
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# Shift Alt vim keys to switch windows
bind -n M-H previous-window
bind -n M-L next-window
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
bind '_' split-window -v -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
'';
};
};
xdg.configFile."lf/icons".source = ./lf-icons;
services.gpg-agent = {
enable = true;
enableSshSupport = true;
pinentryPackage = pkgs.pinentry-gnome3;
};
home.sessionVariables = {
SSH_AUTH_SOCK = "$XDG_RUNTIME_DIR/keyring/ssh";
};
}

377
user/dev/lf-icons Executable file
View file

@ -0,0 +1,377 @@
# vim:ft=conf
# These examples require Nerd Fonts or a compatible font to be used.
# See https://www.nerdfonts.com for more information.
# default values from lf (with matching order)
# ln l # LINK
# or l # ORPHAN
# tw t # STICKY_OTHER_WRITABLE
# ow d # OTHER_WRITABLE
# st t # STICKY
# di d # DIR
# pi p # FIFO
# so s # SOCK
# bd b # BLK
# cd c # CHR
# su u # SETUID
# sg g # SETGID
# ex x # EXEC
# fi - # FILE
# file types (with matching order)
ln  # LINK
or  # ORPHAN
tw t # STICKY_OTHER_WRITABLE
ow  # OTHER_WRITABLE
st t # STICKY
di  # DIR
pi p # FIFO
so s # SOCK
bd b # BLK
cd c # CHR
su u # SETUID
sg g # SETGID
ex  # EXEC
fi  # FILE
# disable some default filetype icons, let them choose icon by filename
# ln  # LINK
# or  # ORPHAN
# tw # STICKY_OTHER_WRITABLE
# ow # OTHER_WRITABLE
# st # STICKY
# di  # DIR
# pi # FIFO
# so # SOCK
# bd # BLK
# cd # CHR
# su # SETUID
# sg # SETGID
# ex # EXEC
# fi  # FILE
# file extensions (vim-devicons)
*.styl 
*.sass 
*.scss 
*.htm 
*.html 
*.slim 
*.haml 
*.ejs 
*.css 
*.less 
*.md 
*.mdx 
*.markdown 
*.rmd 
*.json 
*.webmanifest 
*.js 
*.mjs 
*.jsx 
*.rb 
*.gemspec 
*.rake 
*.php 
*.py 
*.pyc 
*.pyo 
*.pyd 
*.coffee 
*.mustache 
*.hbs 
*.conf 
*.ini 
*.yml 
*.yaml 
*.toml 
*.bat 
*.mk 
*.jpg 
*.jpeg 
*.bmp 
*.png 
*.webp 
*.gif 
*.ico 
*.twig 
*.cpp 
*.c++ 
*.cxx 
*.cc 
*.cp 
*.c 
*.cs 󰌛
*.h 
*.hh 
*.hpp 
*.hxx 
*.hs 
*.lhs 
*.nix 
*.lua 
*.java 
*.sh 
*.fish 
*.bash 
*.zsh 
*.ksh 
*.csh 
*.awk 
*.ps1 
*.ml λ
*.mli λ
*.diff 
*.db 
*.sql 
*.dump 
*.clj 
*.cljc 
*.cljs 
*.edn 
*.scala 
*.go 
*.dart 
*.xul 
*.sln 
*.suo 
*.pl 
*.pm 
*.t 
*.rss 
'*.f#' 
*.fsscript 
*.fsx 
*.fs 
*.fsi 
*.rs 
*.rlib 
*.d 
*.erl 
*.hrl 
*.ex 
*.exs 
*.eex 
*.leex 
*.heex 
*.vim 
*.ai 
*.psd 
*.psb 
*.ts 
*.tsx 
*.jl 
*.pp 
*.vue 
*.elm 
*.swift 
*.xcplayground 
*.tex 󰙩
*.r 󰟔
*.rproj 󰗆
*.sol 󰡪
*.pem 
# file names (vim-devicons) (case-insensitive not supported in lf)
*gruntfile.coffee 
*gruntfile.js 
*gruntfile.ls 
*gulpfile.coffee 
*gulpfile.js 
*gulpfile.ls 
*mix.lock 
*dropbox 
*.ds_store 
*.gitconfig 
*.gitignore 
*.gitattributes 
*.gitlab-ci.yml 
*.bashrc 
*.zshrc 
*.zshenv 
*.zprofile 
*.vimrc 
*.gvimrc 
*_vimrc 
*_gvimrc 
*.bashprofile 
*favicon.ico 
*license 
*node_modules 
*react.jsx 
*procfile 
*dockerfile 
*docker-compose.yml 
*docker-compose.yaml 
*compose.yml 
*compose.yaml 
*rakefile 
*config.ru 
*gemfile 
*makefile 
*cmakelists.txt 
*robots.txt 󰚩
# file names (case-sensitive adaptations)
*Gruntfile.coffee 
*Gruntfile.js 
*Gruntfile.ls 
*Gulpfile.coffee 
*Gulpfile.js 
*Gulpfile.ls 
*Dropbox 
*.DS_Store 
*LICENSE 
*React.jsx 
*Procfile 
*Dockerfile 
*Docker-compose.yml 
*Docker-compose.yaml 
*Rakefile 
*Gemfile 
*Makefile 
*CMakeLists.txt 
# file patterns (vim-devicons) (patterns not supported in lf)
# .*jquery.*\.js$ 
# .*angular.*\.js$ 
# .*backbone.*\.js$ 
# .*require.*\.js$ 
# .*materialize.*\.js$ 
# .*materialize.*\.css$ 
# .*mootools.*\.js$ 
# .*vimrc.* 
# Vagrantfile$ 
# file patterns (file name adaptations)
*jquery.min.js 
*angular.min.js 
*backbone.min.js 
*require.min.js 
*materialize.min.js 
*materialize.min.css 
*mootools.min.js 
*vimrc 
Vagrantfile 
# archives or compressed (extensions from dircolors defaults)
*.tar 
*.tgz 
*.arc 
*.arj 
*.taz 
*.lha 
*.lz4 
*.lzh 
*.lzma 
*.tlz 
*.txz 
*.tzo 
*.t7z 
*.zip 
*.z 
*.dz 
*.gz 
*.lrz 
*.lz 
*.lzo 
*.xz 
*.zst 
*.tzst 
*.bz2 
*.bz 
*.tbz 
*.tbz2 
*.tz 
*.deb 
*.rpm 
*.jar 
*.war 
*.ear 
*.sar 
*.rar 
*.alz 
*.ace 
*.zoo 
*.cpio 
*.7z 
*.rz 
*.cab 
*.wim 
*.swm 
*.dwm 
*.esd 
# image formats (extensions from dircolors defaults)
*.jpg 
*.jpeg 
*.mjpg 
*.mjpeg 
*.gif 
*.bmp 
*.pbm 
*.pgm 
*.ppm 
*.tga 
*.xbm 
*.xpm 
*.tif 
*.tiff 
*.png 
*.svg 
*.svgz 
*.mng 
*.pcx 
*.mov 
*.mpg 
*.mpeg 
*.m2v 
*.mkv 
*.webm 
*.ogm 
*.mp4 
*.m4v 
*.mp4v 
*.vob 
*.qt 
*.nuv 
*.wmv 
*.asf 
*.rm 
*.rmvb 
*.flc 
*.avi 
*.fli 
*.flv 
*.gl 
*.dl 
*.xcf 
*.xwd 
*.yuv 
*.cgm 
*.emf 
*.ogv 
*.ogx 
# audio formats (extensions from dircolors defaults)
*.aac 
*.au 
*.flac 
*.m4a 
*.mid 
*.midi 
*.mka 
*.mp3 
*.mpc 
*.ogg 
*.ra 
*.wav 
*.oga 
*.opus 
*.spx 
*.xspf 
# other formats
*.pdf 

26
user/dev/wezterm.lua Normal file
View file

@ -0,0 +1,26 @@
local wezterm = require 'wezterm'
local config = wezterm.config_builder()
config.color_scheme = 'Oxocarbon Dark (Gogh)'
config.use_fancy_tab_bar = false
config.window_decorations = "RESIZE"
config.hide_tab_bar_if_only_one_tab = true
config.font = wezterm.font "Cascadia Code NF"
config.set_environment_variables = {
TERM = "xterm-256color",
EDITOR = "nvim",
VISUAL = "code --wait",
}
config.window_padding = {
left = 7,
right = 7,
top = 0,
bottom = 0,
}
config.default_cursor_style = 'SteadyBar'
return config

1
user/id_dev.pub Normal file
View file

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBJRVqaCvz582ioiqnNELKIrGy4RkJ4IVorYlJ98iuZz hi@dessa.dev

6
user/services.nix Normal file
View file

@ -0,0 +1,6 @@
{
services.gnome-keyring = {
enable = true;
components = ["secrets" "ssh"];
};
}

112
user/shell/bash.nix Normal file
View file

@ -0,0 +1,112 @@
{
pkgs,
config,
...
}: {
programs.bat.enable = true;
programs.eza.enable = true;
programs.man.enable = true;
programs.wezterm.enableBashIntegration = true;
programs.fzf = {
enable = true;
enableBashIntegration = true;
};
services.gpg-agent.enableBashIntegration = true;
programs.bash = {
enable = true;
enableCompletion = true;
# historyControl = ["erasedups" "ignorespace" "ignoredups" "ignoreboth"]
historyFile = "${config.home.homeDirectory}/.histfile";
historyFileSize = 100000000;
shellOptions = [
"APPEND_HISTORY" # Append to histfile instead of overwriting.
"SHARE_HISTORY" # Share history between all sessions.
"HIST_IGNORE_SPACE" # Do not record an event starting with a space.
"HIST_IGNORE_ALL_DUPS" # Delete an old recorded event if a new event is a duplicate.
"HIST_SAVE_NO_DUPS" # Do not write a duplicate event to the history file.
"HIST_IGNORE_DUPS" # Do not record an event that was just recorded again.
"HIST_FIND_NO_DUPS" # Do not display a previously found event.
"EXTENDED_HISTORY" # Write the history file in the ':start:elapsed;command' format.
"HIST_EXPIRE_DUPS_FIRST" # Expire a duplicate event first when trimming history.
"ALWAYS_TO_END"
"ALWAYS_TO_END"
"AUTO_LIST"
"AUTO_MENU"
"AUTO_PARAM_SLASH"
"AUTO_PUSHD"
"ALWAYS_TO_END"
"COMPLETE_IN_WORD"
"EXTENDED_GLOB"
"INC_APPEND_HISTORY"
"INTERACTIVE_COMMENTS"
"MENU_COMPLETE"
"NO_BEEP"
"NOTIFY"
"PATH_DIRS"
"PUSHD_IGNORE_DUPS"
"PUSHD_SILENT"
"-CASE_GLOB"
"-CORRECT"
"-EQUALS"
"-FLOWCONTROL"
"-NOMATCH"
];
initExtra = ''
eval "$(${pkgs.zoxide}/bin/zoxide init --cmd cd bash)"
eval "$(${pkgs.oh-my-posh}/bin/oh-my-posh init bash --config ${./prompt-zen.toml})"
hash -d "dl"="$HOME/Downloads"
hash -d "docs"="$HOME/Documents"
hash -d "src"="$HOME/src"
hash -d "dots"="$HOME/nix"
hash -d "nix"="$HOME/nix"
hash -d "pics"="$HOME/Pictures"
hash -d "vids"="$HOME/Videos"
'';
sessionVariables = {
SAVEHIST = 1000000000;
HISTDUP = "erase";
DIRENV_LOG_FORMAT = "";
LC_ALL = "en_US.UTF-8";
KEYTIMEOUT = 1;
GPG_TTY = "$(tty)";
PATH = "$PATH:$HOME/bin";
};
shellAliases = {
run = "nix-shell --command 'zsh' -p";
nsh = "nix-shell --command 'zsh'";
nd = "nix develop";
g = "git";
gs = "git st";
gst = "git st";
src = "cd $HOME/dev";
sv0 = "ssh -l root proxmox";
nmcs = "ssh -l kd nmcs";
pn = "pnpm";
rm = "rm -rf";
cp = "cp -ri";
mkdir = "mkdir -p";
free = "free -m";
j = "just";
ed = "code";
n = "nvim";
cdr = "cd \$(git rev-parse --show-toplevel)";
l = "eza -al --no-time --group-directories-first";
ls = "eza -al --no-time --group-directories-first";
la = "eza -a";
ll = "eza -l --no-time --group-directories-first";
lt = "eza -aT --no-time --group-directories-first";
cat = "bat --theme gruvbox-dark --style numbers,changes --color=always --tabs=2 --wrap=never";
diff = "delta";
top = "btm";
c = "clear";
glg = "git lg";
ghr = "gh repo";
serve = "python3 -m http.server";
ytmp3 = "yt-dlp --ignore-errors --format bestaudio --extract-audio --audio-format mp3 --audio-quality 0 --embed-thumbnail --embed-metadata --output '%(title)s.%(ext)s'";
};
};
}

70
user/shell/prompt-zen.toml Executable file
View file

@ -0,0 +1,70 @@
#:schema https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
version = 2
final_space = true
console_title_template = '{{if .Root}}(Admin){{end}} {{ .PWD }}'
[[blocks]]
type = 'prompt'
alignment = 'left'
# [[blocks.segments]]
# type = 'session'
# style = 'plain'
# foreground = '#BF616A'
# template = '{{ .UserName }} '
[[blocks.segments]]
type = 'text'
style = 'plain'
foreground = 'blue'
background = 'transparent'
template = '➜ '
[[blocks.segments]]
type = 'path'
style = 'plain'
foreground = '#81A1C1'
background = 'transparent'
template = '{{ path .Path .Location }} '
[blocks.segments.properties]
style = 'full'
[[blocks.segments]]
type = 'git'
style = 'plain'
foreground = 'p:grey'
background = 'transparent'
template = '{{ .HEAD }}{{if or (.Working.Changed) (.Staging.Changed)}}*{{end}}{{if gt .Behind 0}}⇣{{end}}{{if gt .Ahead 0}}⇡{{end}} '
[blocks.segments.properties]
branch_icon = ''
commit_icon = '@'
fetch_status = true
[[blocks.segments]]
type = 'text'
style = 'plain'
foreground = 'green'
foreground_templates = [
"{{if gt .Code 0}}red{{end}}"
]
background = 'transparent'
template = '{{if eq .UserName "root" }}#{{else}}~{{end}}'
[transient_prompt]
foreground_templates = [
"{{if gt .Code 0}}red{{end}}"
]
foreground = 'green'
background= 'transparent'
template = '~ '
[secondary_prompt]
foreground = '#3c3c3c'
background = 'transparent'
template = '~> '
[pallete]
grey = '#6c6c6c'

183
user/shell/zsh.nix Normal file
View file

@ -0,0 +1,183 @@
{
pkgs,
config,
...
}: {
programs.bat.enable = true;
programs.eza.enable = true;
programs.man.enable = true;
programs.wezterm.enableZshIntegration = true;
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
services.gpg-agent.enableZshIntegration = true;
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
enableCompletion = true;
history = {
path = "${config.home.homeDirectory}/.histfile";
save = 1000000000;
size = 100000000;
};
initExtraBeforeCompInit = ''
# zstyle ':completion:*' menu select
zstyle ':completion:*' menu no
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
zstyle ':completion:*:descriptions' format '[%d]'
zstyle ':completion::complete:*' gain-privileges 1
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath'
zstyle ':fzf-tab:complete:+__zoxide_z:*' fzf-preview 'eza -1 --color=always $realpath'
zstyle ':fzf-tab:*' switch-group '<' '>'
zstyle ':completion:*:git-checkout:*' sort false
# _comp_options+=(globdots)
'';
initExtra = ''
setopt APPEND_HISTORY # Append to histfile instead of overwriting.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_IGNORE_SPACE # Do not record an event starting with a space.
setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate.
setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file.
setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again.
setopt HIST_FIND_NO_DUPS # Do not display a previously found event.
setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format.
setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history.
# Set the directory we want to store zinit (and plugins) in
# The XDG_DATA_HOME:-$HOME... line chooses XDG_DATA_HOME if it exists, otherwise .local/share
ZINIT_HOME="''${XDG_DATA_HOME:-''${HOME}/.local/share}/zinit/zinit.git"
# download zinit if it doesn't exist
if [ ! -d "$ZINIT_HOME" ]; then
mkdir -p "$(dirname $ZINIT_HOME)"
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
fi
# load zinit
source "''${ZINIT_HOME}/zinit.zsh"
#region plugins
zinit light zsh-users/zsh-completions
autoload -U compinit && compinit
eval "$(fzf --zsh)"
zinit light Aloxaf/fzf-tab
zinit light zsh-users/zsh-syntax-highlighting
zinit light zsh-users/zsh-autosuggestions
# snippets
zinit snippet OMZP::git
zinit snippet OMZP::sudo
zinit snippet OMZP::debian
zinit snippet OMZP::command-not-found
zinit snippet OMZP::extract
zinit cdreplay -q
eval "$(zoxide init --cmd cd zsh)"
#endregion
#region setopts
while read -r option; do
setopt $option
done <<-EOF
ALWAYS_TO_END
AUTO_LIST
AUTO_MENU
AUTO_PARAM_SLASH
AUTO_PUSHD
ALWAYS_TO_END
COMPLETE_IN_WORD
EXTENDED_GLOB
INC_APPEND_HISTORY
INTERACTIVE_COMMENTS
MENU_COMPLETE
NO_BEEP
NOTIFY
PATH_DIRS
PUSHD_IGNORE_DUPS
PUSHD_SILENT
EOF
while read -r option; do
unsetopt $option
done <<-EOF
CASE_GLOB
CORRECT
EQUALS
FLOWCONTROL
NOMATCH
EOF
#endregion
# bindkey -v
# zmodload zsh/complist
# bindkey -M menuselect 'h' vi-backward-char
# bindkey -M menuselect 'k' vi-up-line-or-history
# bindkey -M menuselect 'l' vi-forward-char
# bindkey -M menuselect 'j' vi-down-line-or-history
bindkey "^a" vi-beginning-of-line
bindkey "^e" vi-end-of-line
bindkey '^p' history-search-backward
bindkey '^n' history-search-forward
bindkey '^f' autosuggest-accept
bindkey -M emacs '^[^[' sudo-command-line
bindkey -M vicmd '^[^[' sudo-command-line
bindkey -M viins '^[^[' sudo-command-line
# prompt init
eval "$(${pkgs.oh-my-posh}/bin/oh-my-posh init zsh --config ${./prompt-zen.toml})"
'';
dirHashes = {
dl = "${config.home.homeDirectory}/Downloads";
docs = "${config.home.homeDirectory}/Documents";
src = "${config.home.homeDirectory}/src";
dots = "${config.home.homeDirectory}/nix";
nix = "${config.home.homeDirectory}/nix";
pics = "${config.home.homeDirectory}/Documents";
vids = "${config.home.homeDirectory}/Documents";
};
sessionVariables = {
DIRENV_LOG_FORMAT = "";
LC_ALL = "en_US.UTF-8";
# SSH_AUTH_SOCK = "$(gpgconf --list-dirs agent-ssh-socket)";
KEYTIMEOUT = 1;
GPG_TTY = "$(tty)";
PATH = "$PATH:$HOME/bin";
# FLAKE = "$HOME/sysconf/nix";
};
shellAliases = {
run = "nix-shell --command 'zsh' -p";
nsh = "nix-shell --command 'zsh'";
nd = "nix develop";
g = "git";
gs = "git st";
gst = "git st";
src = "cd $HOME/dev";
sv0 = "ssh -l root proxmox";
nmcs = "ssh -l kd nmcs";
pn = "pnpm";
rm = "rm -rf";
cp = "cp -ri";
mkdir = "mkdir -p";
free = "free -m";
j = "just";
ed = "code";
n = "nvim";
cdr = "cd \$(git rev-parse --show-toplevel)";
l = "eza -al --no-time --group-directories-first";
ls = "eza -al --no-time --group-directories-first";
la = "eza -a";
ll = "eza -l --no-time --group-directories-first";
lt = "eza -aT --no-time --group-directories-first";
cat = "bat --theme gruvbox-dark --style numbers,changes --color=always --tabs=2 --wrap=never";
diff = "delta";
top = "btm";
c = "clear";
glg = "git lg";
ghr = "gh repo";
serve = "python3 -m http.server";
ytmp3 = "yt-dlp --ignore-errors --format bestaudio --extract-audio --audio-format mp3 --audio-quality 0 --embed-thumbnail --embed-metadata --output '%(title)s.%(ext)s'";
};
};
}

167
user/shell/zshrc Executable file
View file

@ -0,0 +1,167 @@
# Created by newuser for 5.9
HISTFILE=~/.histfile
HISTSIZE=100000000
SAVEHIST=1000000000
HISTDUP=erase
setopt APPEND_HISTORY # Append to histfile instead of overwriting.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_IGNORE_SPACE # Do not record an event starting with a space.
setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate.
setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file.
setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again.
setopt HIST_FIND_NO_DUPS # Do not display a previously found event.
setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format.
setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history.
# Set the directory we want to store zinit (and plugins) in
# The XDG_DATA_HOME:-$HOME... line chooses XDG_DATA_HOME if it exists, otherwise .local/share
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
# download zinit if it doesn't exist
if [ ! -d "$ZINIT_HOME" ]; then
mkdir -p "$(dirname $ZINIT_HOME)"
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
fi
# load zinit
source "${ZINIT_HOME}/zinit.zsh"
#region plugins
zinit light zsh-users/zsh-completions
autoload -U compinit && compinit
eval "$(fzf --zsh)"
zinit light Aloxaf/fzf-tab
zinit light zsh-users/zsh-syntax-highlighting
zinit light zsh-users/zsh-autosuggestions
# snippets
zinit snippet OMZP::git
zinit snippet OMZP::sudo
zinit snippet OMZP::debian
zinit snippet OMZP::command-not-found
zinit snippet OMZP::extract
zinit cdreplay -q
eval "$(zoxide init --cmd cd zsh)"
#endregion
#region setopts
while read -r option; do
setopt $option
done <<-EOF
ALWAYS_TO_END
AUTO_LIST
AUTO_MENU
AUTO_PARAM_SLASH
AUTO_PUSHD
ALWAYS_TO_END
COMPLETE_IN_WORD
EXTENDED_GLOB
INC_APPEND_HISTORY
INTERACTIVE_COMMENTS
MENU_COMPLETE
NO_BEEP
NOTIFY
PATH_DIRS
PUSHD_IGNORE_DUPS
PUSHD_SILENT
EOF
while read -r option; do
unsetopt $option
done <<-EOF
CASE_GLOB
CORRECT
EQUALS
FLOWCONTROL
NOMATCH
EOF
#endregion
# bindkey -v
# zmodload zsh/complist
# bindkey -M menuselect 'h' vi-backward-char
# bindkey -M menuselect 'k' vi-up-line-or-history
# bindkey -M menuselect 'l' vi-forward-char
# bindkey -M menuselect 'j' vi-down-line-or-history
bindkey "^a" vi-beginning-of-line
bindkey "^e" vi-end-of-line
bindkey '^p' history-search-backward
bindkey '^n' history-search-forward
bindkey '^f' autosuggest-accept
bindkey -M emacs '^[^[' sudo-command-line
bindkey -M vicmd '^[^[' sudo-command-line
bindkey -M viins '^[^[' sudo-command-line
# zstyle ':completion:*' menu select
zstyle ':completion:*' menu no
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*:descriptions' format '[%d]'
zstyle ':completion::complete:*' gain-privileges 1
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath'
zstyle ':fzf-tab:complete:+__zoxide_z:*' fzf-preview 'eza -1 --color=always $realpath'
zstyle ':fzf-tab:*' switch-group '<' '>'
zstyle ':completion:*:git-checkout:*' sort false
# _comp_options+=(globdots)
# prompt init
eval "$(oh-my-posh init zsh --config ~/.config/omp/zen.toml)"
#region dirHashes
hash -d "dl"="$HOME/Downloads"
hash -d "docs"="$HOME/Documents"
hash -d "dev"="$HOME/dev"
hash -d "dots"="$HOME/sysconf"
hash -d "pics"="$HOME/Pictures"
hash -d "vids"="$HOME/Videos"
#endregion
#region env
export DIRENV_LOG_FORMAT=""
export LC_ALL="en_US.UTF-8"
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
export KEYTIMEOUT=1
export GPG_TTY=$(tty)
export PATH="$PATH:$HOME/bin"
export FLAKE="$HOME/sysconf/nix"
#endregion
#region aliases
alias run="nix-shell --command 'zsh' -p"
alias nsh="nix-shell --command 'zsh'"
alias nd="nix develop"
alias g="git"
alias gs="git st"
alias gst="git st"
alias src="cd $HOME/dev"
alias sv0="ssh -l root proxmox"
alias nmcs="ssh -l kd nmcs"
alias pn="pnpm"
alias rm="rm -rf"
alias cp="cp -ri"
alias mkdir="mkdir -p"
alias free="free -m"
alias j="just"
alias ed="code"
alias n="nvim"
alias cdr="cd \$(git rev-parse --show-toplevel)"
alias l="eza -al --no-time --group-directories-first"
alias ls="eza -al --no-time --group-directories-first"
alias la="eza -a"
alias ll="eza -l --no-time --group-directories-first"
alias lt="eza -aT --no-time --group-directories-first"
alias cat="bat --theme gruvbox-dark --style numbers,changes --color=always --tabs=2 --wrap=never"
alias diff="delta"
alias top="btm"
alias c="clear"
alias glg="git lg"
alias ghr="gh repo"
alias serve="python3 -m http.server"
alias ytmp3="yt-dlp --ignore-errors --format bestaudio --extract-audio --audio-format mp3 --audio-quality 0 --embed-thumbnail --embed-metadata --output '%(title)s.%(ext)s'"
#endregion

20
user/users.nix Normal file
View file

@ -0,0 +1,20 @@
{pkgs, ...}: {
users.users.deva = {
isNormalUser = true;
shell = pkgs.zsh;
description = "Deva Waves";
initialPassword = "12345";
extraGroups = ["wheel" "networkmanager" "audio" "docker" "input" "libvirtd" "plugdev" "video" "adbusers"];
openssh.authorizedKeys.keys = [
(builtins.readFile ./id_dev.pub)
];
};
users.users.root = {
shell = pkgs.zsh;
openssh.authorizedKeys.keys = [
(builtins.readFile ./id_dev.pub)
];
};
}

30
waves-hardware.nix Normal file
View file

@ -0,0 +1,30 @@
# 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 = ["xhci_pci" "thunderbolt" "vmd" "nvme" "usbhid" "uas" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = ["dm-snapshot"];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
# 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.enp58s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}