Compare commits

...

5 Commits

Author SHA1 Message Date
a56fc0c35f fixes and cleanup after config rename 2024-12-26 15:56:31 +01:00
ec4abe0496 rename config to kogami and ginoza 2024-12-26 15:56:17 +01:00
277779202d sops and user in own modules 2024-12-26 15:29:36 +01:00
4cf3e09d41 shell customization 2024-12-26 13:44:36 +01:00
1d2edfb87f fixes and cleanup 2024-12-26 13:43:38 +01:00
27 changed files with 253 additions and 135 deletions

View File

@ -1,14 +1,33 @@
# dotfiles
- my personal nix dotfiles in flake
- my personal nix dotfiles in the **flake**
- simple build command for system
```bash
git clone https://git.foglar.tech/foglar/dotfiles.git $HOME/dotfiles --depth 1
git clone https://git.foglar.tech/foglar/dotfiles.git $HOME/dotfiles
sudo nixos-rebuild switch --flake ~/dotfiles#laptop
```
- generate a vm of the flake with this command
```bash
nix run github:nix-community/nixos-generators -- -c ./flake.nix --flake '#leanix' -f vm --disk-size 20480
```
- deploy configuration on the new system
```bash
# Copy my repository
git clone https://git.foglar.tech/foglar/dotfiles.git $HOME/dotfiles --depth 1
# Generate your own hardware configurations for system
sudo nixos-generate-config --dir ~/dotfiles/zenith
# or
sudo nixos-generate-config --dir ~/dotfiles/leanix
# Rebuild your system from the flake
sudo nixos-rebuild switch --flake ~/dotfiles#zenith
```
## Features

31
TODO.md
View File

@ -1,11 +1,24 @@
# TODO
- [ ] Wallpaper switch
- [x] Keyboard switch
- [x] Waybar fix
- [x] Rofi config
- [ ] Cliphist manager fix
- [x] Stylix theming to each module
- [ ] Enabling nvidia graphics and disabling it
- [ ] Modularity connected via configuration.nix file with home manager (disable gnome, gnome configuration will be disabled too)
- [x] Rofi theme and other themes, where are colors setup declaratively
- [x] wallpaper switch
- [x] keyboard switch
- [x] waybar fix
- [x] rofi config
- [x] cliphist manager fix
- [x] stylix theming to each module
- [x] rofi theme and other themes, where are colors setup declaratively
- [ ] enabling nvidia graphics and disabling it
- [ ] modularity connected via configuration.nix file with home manager (disable gnome, gnome configuration will be disabled too)
- [x] custom if else statements
- [ ] neovim
- [ ] librewolf and firefox fix
- [ ] fix kde theme in stylix
- [x] move sops
- [ ] figure out yubico authentication
- [ ] graph of my system structure
- [x] add zsh to my config
- [ ] ?tryout starship?
- [ ] cleanup hyprland subtools (rofi, hyprlock, waybar)
- [ ] auto-cpufreq
- [ ] modularize hyprland config into multiple files
- [ ] consider moving nh config helper into module

View File

@ -5,6 +5,11 @@
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs";
@ -15,6 +20,12 @@
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
spicetify-nix = {
url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
@ -25,17 +36,6 @@
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
@ -54,10 +54,10 @@
...
} @ inputs: let
userSettings = {
username = "foglar"; # konsta or foglar (else defaulting to foglar or none)
hostname = "laptop";
username = "foglar"; # konsta or shinya (else defaulting to shinya or none)
hostname = "kogami"; # kogami or ginoza
shell = "bash"; # bash, zsh
shell = "zsh"; # bash, zsh, none
terminal = "kitty"; # kitty, alacritty
browser = "librewolf"; # firefox, librewolf, qutebrowser
editor = "neovim"; # neovim, vscode
@ -86,28 +86,28 @@
};
in {
nixosConfigurations = {
laptop = nixpkgs.lib.nixosSystem {
kogami = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs system pkgs pkgs-stable userSettings;
};
modules = [
./zenith/configuration.nix
./kogami/configuration.nix
inputs.stylix.nixosModules.stylix
inputs.nix-ld.nixosModules.nix-ld
inputs.sops-nix.nixosModules.sops
];
};
leanix = nixpkgs.lib.nixosSystem {
ginoza = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs system pkgs pkgs-stable userSettings;
};
modules = [
./leanix/configuration.nix
./ginoza/configuration.nix
inputs.stylix.nixosModules.stylix
];
};

View File

@ -23,21 +23,9 @@
};
};
# User configuration
users.users.${userSettings.username} = {
isNormalUser = true;
description = "${userSettings.username}";
extraGroups = ["wheel"];
};
# Bootloader
boot.loader.systemd-boot.enable = true;
# Environment variables
environment.sessionVariables = {
FLAKE = "/home/${userSettings.username}/.dotfiles";
};
# System level configuration
sys = {
audio.enable = true;
@ -61,6 +49,7 @@
gdm.enable = true;
};
style.enable = true;
security.sops.enable = true;
};
# Configured programs to enable

View File

@ -17,11 +17,17 @@
desktop.gnome.enable = true;
# Shell management
sh.oh-my-posh.enable = false;
sh.bash = {
enable = true;
oh-my-posh.enable = false;
};
sh.zsh = {
enable = false;
oh-my-posh.enable = false;
};
# Application lists
app_list = {
hacking.enable = false;
@ -38,7 +44,7 @@
vscode.enable = false;
git.enable = false;
neovim.enable = false;
firefox.enable = false;
firefox.enable = true;
spotify.enable = false;
};

View File

@ -3,7 +3,6 @@
pkgs,
pkgs-stable,
userSettings,
config,
...
}: {
imports = [
@ -17,15 +16,6 @@
nix.settings.experimental-features = ["nix-command" "flakes"];
programs.nix-ld.dev.enable = true;
sops.defaultSopsFile = ./secrets/secrets.yaml;
sops.defaultSopsFormat = "yaml";
sops.age.keyFile = "/home/foglar/.config/sops/age/keys.txt";
sops.secrets."zenith/password-hash" = {
neededForUsers = true;
};
# Home manager
home-manager = {
extraSpecialArgs = {inherit inputs pkgs pkgs-stable userSettings;};
@ -39,22 +29,9 @@
];
};
# User configuration
users.users.${userSettings.username} = {
isNormalUser = true;
description = "${userSettings.username}";
extraGroups = ["wheel"];
hashedPasswordFile = "${config.sops.secrets."zenith/password-hash".path}";
};
# Bootloader
boot.loader.systemd-boot.enable = true;
# Environment variables
environment.sessionVariables = {
FLAKE = "/home/${userSettings.username}/dotfiles";
};
# System level configuration
sys = {
audio.enable = true;

View File

@ -15,11 +15,18 @@
desktop.gnome.enable = false;
# Shell management
sh.oh-my-posh.enable = true;
sh.bash = {
enable = true;
oh-my-posh.enable = true;
};
sh.zsh = {
enable = true;
oh-my-posh.enable = true;
};
# Application lists
app_list = {
applications.enable = true;

View File

@ -18,8 +18,7 @@
conda
jetbrains.pycharm-professional
dotnet-sdk_8
nodejs
pnpm
git-ignore
];
nixpkgs.config.allowUnfreePredicate = pkg:

View File

@ -18,7 +18,6 @@
jp2a
yt-dlp
nvtopPackages.full
neofetch
wget
curl
fzf

View File

@ -38,6 +38,7 @@
services.network-manager-applet.enable = true;
services.dunst.enable = true;
programs.hyprlock.enable = true;
home.sessionVariables = {

View File

@ -137,7 +137,7 @@
ublock-origin
]
++ (
if (userSettings.username == "foglar")
if (userSettings.username == "shinya")
then [
inputs.firefox-addons.packages."x86_64-linux".simple-translate
inputs.firefox-addons.packages."x86_64-linux".duckduckgo-privacy-essentials

View File

@ -26,10 +26,29 @@
];
sh.bash = {
enable = lib.mkDefault true;
oh-my-posh.enable = lib.mkDefault true;
enable =
if userSettings.shell == "bash"
then lib.mkDefault true
else lib.mkDefault false;
oh-my-posh.enable =
if userSettings.shell == "bash"
then lib.mkDefault true
else lib.mkDefault false;
};
sh.zsh = {
enable =
if userSettings.shell == "zsh"
then lib.mkDefault true
else lib.mkDefault false;
oh-my-posh.enable =
if userSettings.shell == "zsh"
then lib.mkDefault true
else lib.mkDefault false;
};
sh.oh-my-posh.enable = lib.mkDefault true;
program = {
kitty.enable =
if userSettings.terminal == "kitty"

View File

@ -3,6 +3,7 @@
pkgs-stable,
lib,
config,
userSettings,
...
}: {
options = {
@ -141,7 +142,7 @@
};
"options" = {
"nixos" = {
"expr" = "(builtins.getFlake \"~/dotfiles/\").nixosConfigurations.laptop.options";
"expr" = "(builtins.getFlake \"~/.dotfiles/\").nixosConfigurations.${userSettings.hostname}.options";
};
};
# "home_manager": {

View File

@ -12,6 +12,9 @@
home.sessionVariables.EDITOR = "nvim";
programs.neovim.enable = true;
programs.neovim.defaultEditor = true;
programs.neovim.viAlias = true;
programs.neovim.vimAlias = true;
#programs.neovim = let
# toLua = str: "lua << EOF\n${str}\nEOF\n";

View File

@ -5,13 +5,24 @@
...
}: {
options = {
sh.bash.oh-my-posh.enable = lib.mkEnableOption "enable oh-my-posh";
sh.oh-my-posh.enable = lib.mkEnableOption "enable oh-my-posh";
sh.bash.oh-my-posh.enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "enable oh-my-posh for bash";
};
sh.zsh.oh-my-posh.enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "enable oh-my-posh for zsh";
};
};
config = lib.mkIf config.sh.bash.oh-my-posh.enable {
config = lib.mkIf config.sh.oh-my-posh.enable {
programs.oh-my-posh = {
enable = true;
enableBashIntegration = true;
enableBashIntegration = if config.sh.bash.enable == true then true else false;
enableZshIntegration = if config.sh.zsh.enable == true then true else false;
settings = {
"$schema" = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json";
"blocks" = [

View File

@ -5,17 +5,17 @@
...
}: {
options = {
sh.bash.enable =
lib.mkEnableOption "enables shell tools";
sh.bash.enable = lib.mkEnableOption "enables shell bash";
sh.zsh.enable = lib.mkEnableOption "enables shell zsh";
};
config = lib.mkIf config.sh.bash.enable {
config = lib.mkMerge [
(lib.mkIf config.sh.bash.enable {
programs.bash = {
enable = true;
enableCompletion = true;
shellAliases = {
#vim = "nvim";
ls = "${pkgs.eza}/bin/eza --icons";
ll = "${pkgs.eza}/bin/eza -alh --icons";
l = "${pkgs.eza}/bin/eza -lh --icons=auto";
@ -41,9 +41,31 @@
};
home.sessionVariables = {
FLAKE = "/home/foglar/dotfiles";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_PICTURES_DIR = "$HOME/Pictures/Screenshots/";
};
})
(lib.mkIf config.sh.zsh.enable {
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
ls = "${pkgs.eza}/bin/eza --icons";
ll = "${pkgs.eza}/bin/eza -alh --icons";
l = "${pkgs.eza}/bin/eza -lh --icons=auto";
tree = "${pkgs.eza}/bin/eza --tree --icons";
open = "rifle";
ip = "ip -c";
s = "kitten ssh";
diff = "diff --color";
respawn = "clear; ${pkgs.pfetch}/bin/pfetch";
mkdir = "mkdir -p";
cat = "${pkgs.bat}/bin/bat --style plain";
};
};
})
];
}

View File

@ -1,4 +1,7 @@
{lib, ...}: {
{
lib,
...
}: {
imports = [
./packages/docker.nix
./packages/podman.nix
@ -6,6 +9,7 @@
./packages/tor.nix
./packages/virtual-machines.nix
./packages/yubikey.nix
./packages/sops/sops.nix
];
program = {
@ -19,6 +23,7 @@
yubikey.enable = lib.mkDefault false;
};
sys.desktop.steamdeck.enable = lib.mkDefault false;
sys.security.sops.enable = lib.mkDefault true;
programs.kdeconnect.enable = lib.mkDefault true;
programs.wireshark.enable = lib.mkDefault true;
}

View File

@ -0,0 +1,24 @@
kogami:
password-hash: ENC[AES256_GCM,data:HXuzumA7zAzBUcOBszeslYVDLA7r3W7gINn2FvMCTEHkc+y3zWftK4CVnk+TuRcgP9/htUphs2BmusogFAdmRQ3HmQU8WGQN0A==,iv:n2063dWbEmFKEvXbY2uk+C6lwF7WzA8jalKOFHPVICc=,tag:wb5bq4Dk3a9UnzYFBInHEA==,type:str]
ginoza:
password-hash: ENC[AES256_GCM,data:xqE0y3Z7+kasYFQLn4Wuo+/c9L8BEakf2HKgN5BsttC2iDuzYSvXrP8K6pe5Skdi5Aq0MVz9LixJFM3PBgLORL1C6k0iDSardw==,iv:bKL40h0rGNmnnkA7EieKAD5KyENXOiTNsTVH1V0B7HU=,tag:c1MsRuiOK/j2b0iKOyO8FQ==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1xzkhm0m0gzph8akd7zjv4880hrauynk80ldktld0r44pgn48le5q3tfw8l
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBwME1uUDlWc2RDTWw0dGly
TEx0dWtxOGlsdGtLVmpMZzRqcUN0d0VNOGxZCkkraGs3cjRIQ3o1MUN4eXZnbXhU
MXROMzYrenkyVS9TTStmZnVGRXF4YVkKLS0tIFhVUnIyMHdtQ2VZQlQrbCtTWHVG
T0cxV21SN0hJaFg3R3hpTjIxa3lJNVEKdIrR5XDHxpCojk2A1pxc4dYtSJRrObbY
JS/nDgu74LugEchiOhuIJ7nh3MS5XBOmmt2GTHrqxZEZFoIykjIGug==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-12-26T14:50:21Z"
mac: ENC[AES256_GCM,data:db57wvxR3NK0OgI9qAzpjOg2dvcb5H7kY1GvyZmfyUoQpapwTuci36sEwFHDPSUXynzobmhiv49kAEsYm0xhvOhTW1tPReVKi4pKh4EFYl0qOeMs0/cM0pwDCyVkjTQh3qlRR+PFB2oSxDdi7rZFfz26P1iFlEHhvsYug/v16Rs=,iv:m40T1K279d5/7u2jtytwS5UMv6V7RDFpNXQxFEAOauU=,tag:+UQ61SLtcVUIixsT0JnXYA==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.2

View File

@ -0,0 +1,23 @@
{
lib,
config,
userSettings,
...
}: {
options = {
sys.security.sops.enable = lib.mkEnableOption "Enable SOPS";
};
config = lib.mkIf config.sys.security.sops.enable {
sops.defaultSopsFile = ./secrets/secrets.yaml;
sops.defaultSopsFormat = "yaml";
sops.age.keyFile = "/home/${userSettings.username}/.config/sops/age/keys.txt";
sops.secrets."${userSettings.hostname}/password-hash" = {
neededForUsers = true;
};
users.users.${userSettings.username}.hashedPasswordFile = "${config.sops.secrets."${userSettings.hostname}/password-hash".path}";
};
}

View File

@ -19,6 +19,7 @@
DEFAULT_BROWSER = "${pkgs."${userSettings.browser}"}/bin/${userSettings.browser}";
TERMINAL = "${pkgs."${userSettings.terminal}"}/bin/${userSettings.terminal}";
EDITOR = "${pkgs."${userSettings.editor}"}/bin/${userSettings.editor}";
FLAKE = "/home/${userSettings.username}/.dotfiles";
};
# Default applications configuration
@ -46,5 +47,14 @@
"image/jpeg" = "org.gnome.Loupe.desktop";
"image/png" = "org.gnome.Loupe.desktop";
};
programs.zsh.enable =
if userSettings.shell == "zsh"
then lib.mkDefault true
else lib.mkDefault false;
users.defaultUserShell =
if userSettings.shell == "zsh"
then pkgs.zsh
else pkgs.bash;
};
}

View File

@ -60,6 +60,7 @@
};
services.udisks2.enable = true;
services.power-profiles-daemon.enable = true;
security = {
polkit.enable = true;

View File

@ -0,0 +1,11 @@
{userSettings, ...}: {
# User configuration
users.users.${userSettings.username} = {
isNormalUser = true;
description = "${userSettings.username}";
extraGroups = ["wheel"];
#! User Hashed password is stored in SOPS
#! and is set in the module configuration
#! file ../packages/sops/sops.nix
};
}

View File

@ -10,6 +10,8 @@
./settings/loginManager.nix
./settings/style.nix
./settings/default-applications.nix
./settings/user.nix
];
sys = {

View File

@ -1,24 +0,0 @@
zenith:
password-hash: ENC[AES256_GCM,data:J0OpGQHKugEvDMJJsLApO4JFmAM4e01WODyonrwUinND/MpzxAjbozlMrDQqb8Lghay3RTOCrslizYIYOkNwUU+MhyFlTAbF7Q==,iv:J4PXhVAUcv1QSycdvQL2jb/IcayyXVdfiJDHiNUalXk=,tag:bm4N8mq/6QUdzwOcy6WVaw==,type:str]
leanix:
password-hash: ENC[AES256_GCM,data:C5oGejwFkhhYvaDunG0AF9PcCKTQQA//uqi1LaWwEwOphepROoP9d1r1vD8k2cgcrikVSX4NQUBca6fQrqZTXMuxZKBxslE2Fw==,iv:oM2pWAifpCEpTRiGKbbG/QdQ0m8YaoyESzD3rIZkvmc=,tag:W+w3Bbtr8rBfp6SjYwcW0Q==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1xzkhm0m0gzph8akd7zjv4880hrauynk80ldktld0r44pgn48le5q3tfw8l
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBwME1uUDlWc2RDTWw0dGly
TEx0dWtxOGlsdGtLVmpMZzRqcUN0d0VNOGxZCkkraGs3cjRIQ3o1MUN4eXZnbXhU
MXROMzYrenkyVS9TTStmZnVGRXF4YVkKLS0tIFhVUnIyMHdtQ2VZQlQrbCtTWHVG
T0cxV21SN0hJaFg3R3hpTjIxa3lJNVEKdIrR5XDHxpCojk2A1pxc4dYtSJRrObbY
JS/nDgu74LugEchiOhuIJ7nh3MS5XBOmmt2GTHrqxZEZFoIykjIGug==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-12-23T18:49:40Z"
mac: ENC[AES256_GCM,data:fWWZ3+RnGkQYP1R7q47JyB6NXHKG+D+y+qaB7i+uGfHsIf6VCkerO/ITCk4WSkvsXJDpB9mZWp2ciYypcDAHuBOlZzLscf/et9xDoDhXdM7MgRsX3fA9oeK9Q8D83cUptELlfXKU0Kvs02fAjbDrbwx5rdUtcUxfPNjW2X5lJ3o=,iv:5UwqRhZnj+u29O+x+KjxZJ9x1hcKuuZlnFYbgFnjkTs=,tag:w/z8u8PYkcW7etYg7y6y8w==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.2