mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-04-02 11:12:09 +02:00
add desktop host
This commit is contained in:
16
flake.nix
16
flake.nix
@@ -41,7 +41,8 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
nur.url = "github:nix-community/NUR";
|
nur.url = "github:nix-community/NUR";
|
||||||
zen-browser.url = "git+https://git.sr.ht/~canasta/zen-browser-flake/"; # updated flake
|
zen-browser.url =
|
||||||
|
"git+https://git.sr.ht/~canasta/zen-browser-flake/"; # updated flake
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ nixpkgs, ... }: {
|
outputs = inputs@{ nixpkgs, ... }: {
|
||||||
@@ -62,6 +63,19 @@
|
|||||||
./hosts/laptop/configuration.nix # CHANGEME: change the path to match your host folder
|
./hosts/laptop/configuration.nix # CHANGEME: change the path to match your host folder
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
desktop = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
{
|
||||||
|
nixpkgs.overlays = [ inputs.hyprpanel.overlay inputs.nur.overlay ];
|
||||||
|
_module.args = { inherit inputs; };
|
||||||
|
}
|
||||||
|
inputs.home-manager.nixosModules.home-manager
|
||||||
|
inputs.stylix.nixosModules.stylix
|
||||||
|
./hosts/desktop/configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
29
hosts/desktop/configuration.nix
Normal file
29
hosts/desktop/configuration.nix
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{ config, ... }: {
|
||||||
|
imports = [
|
||||||
|
../../nixos/audio.nix
|
||||||
|
../../nixos/auto-upgrade.nix
|
||||||
|
../../nixos/fonts.nix
|
||||||
|
../../nixos/home-manager.nix
|
||||||
|
../../nixos/network-manager.nix
|
||||||
|
../../nixos/nix.nix
|
||||||
|
../../nixos/systemd-boot.nix
|
||||||
|
../../nixos/timezone.nix
|
||||||
|
../../nixos/tuigreet.nix
|
||||||
|
../../nixos/users.nix
|
||||||
|
../../nixos/utils.nix
|
||||||
|
../../nixos/xdg-portal.nix
|
||||||
|
../../nixos/variables-config.nix
|
||||||
|
../../nixos/docker.nix
|
||||||
|
|
||||||
|
# Choose your theme here
|
||||||
|
../../themes/stylix/pinky.nix
|
||||||
|
|
||||||
|
./hardware-configuration.nix
|
||||||
|
./variables.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
home-manager.users."${config.var.username}" = import ./home.nix;
|
||||||
|
|
||||||
|
# Don't touch this
|
||||||
|
system.stateVersion = "24.05";
|
||||||
|
}
|
||||||
38
hosts/desktop/hardware-configuration.nix
Normal file
38
hosts/desktop/hardware-configuration.nix
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# 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" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/3d676a57-26eb-4616-b51e-da92dac44483";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/EE89-B594";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0077" "dmask=0077" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# 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.enp3s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
88
hosts/desktop/home.nix
Normal file
88
hosts/desktop/home.nix
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
{ pkgs, config, ... }: {
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./variables.nix
|
||||||
|
|
||||||
|
# Programs
|
||||||
|
../../home/programs/kitty
|
||||||
|
../../home/programs/nvim
|
||||||
|
../../home/programs/qutebrowser
|
||||||
|
../../home/programs/shell
|
||||||
|
../../home/programs/fetch
|
||||||
|
../../home/programs/git
|
||||||
|
../../home/programs/spicetify
|
||||||
|
../../home/programs/nextcloud
|
||||||
|
../../home/programs/yazi
|
||||||
|
../../home/programs/markdown
|
||||||
|
../../home/programs/thunar
|
||||||
|
../../home/programs/lazygit
|
||||||
|
../../home/programs/nh
|
||||||
|
|
||||||
|
# Scripts
|
||||||
|
../../home/scripts # All scripts
|
||||||
|
|
||||||
|
# System (Desktop environment like stuff)
|
||||||
|
../../home/system/hyprland
|
||||||
|
../../home/system/hypridle
|
||||||
|
../../home/system/hyprlock
|
||||||
|
../../home/system/hyprpanel
|
||||||
|
../../home/system/hyprpaper
|
||||||
|
../../home/system/gtk
|
||||||
|
../../home/system/wofi
|
||||||
|
../../home/system/zathura
|
||||||
|
../../home/system/mime
|
||||||
|
../../home/system/udiskie
|
||||||
|
../../home/system/clipman
|
||||||
|
];
|
||||||
|
|
||||||
|
home = {
|
||||||
|
inherit (config.var) username;
|
||||||
|
homeDirectory = "/home/" + config.var.username;
|
||||||
|
|
||||||
|
packages = with pkgs; [
|
||||||
|
# Apps
|
||||||
|
discord # Chat
|
||||||
|
bitwarden # Password manager
|
||||||
|
vlc # Video player
|
||||||
|
blanket # White-noise app
|
||||||
|
|
||||||
|
# Dev
|
||||||
|
go
|
||||||
|
nodejs
|
||||||
|
python3
|
||||||
|
jq
|
||||||
|
figlet
|
||||||
|
just
|
||||||
|
|
||||||
|
# Utils
|
||||||
|
zip
|
||||||
|
unzip
|
||||||
|
optipng
|
||||||
|
pfetch
|
||||||
|
pandoc
|
||||||
|
btop
|
||||||
|
|
||||||
|
# Just cool
|
||||||
|
peaclock
|
||||||
|
cbonsai
|
||||||
|
pipes
|
||||||
|
cmatrix
|
||||||
|
cava
|
||||||
|
|
||||||
|
# Backup
|
||||||
|
vscode
|
||||||
|
firefox
|
||||||
|
neovide
|
||||||
|
|
||||||
|
pnpm
|
||||||
|
];
|
||||||
|
|
||||||
|
# Import my profile picture, used by the hyprpanel dashboard
|
||||||
|
file.".profile_picture.png" = { source = ./profile_picture.png; };
|
||||||
|
|
||||||
|
# Don't touch this
|
||||||
|
stateVersion = "24.05";
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
}
|
||||||
BIN
hosts/desktop/profile_picture.png
Normal file
BIN
hosts/desktop/profile_picture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
37
hosts/desktop/secrets/default.nix
Normal file
37
hosts/desktop/secrets/default.nix
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# Those are my secrets, encrypted with sops
|
||||||
|
# You shouldn't import this file, unless you edit it
|
||||||
|
{ pkgs, inputs, ... }: {
|
||||||
|
imports = [ inputs.sops-nix.homeManagerModules.sops ];
|
||||||
|
|
||||||
|
sops = {
|
||||||
|
age.keyFile = "/home/hadi/.config/sops/age/keys.txt";
|
||||||
|
defaultSopsFile = ./secrets.yaml;
|
||||||
|
secrets = {
|
||||||
|
sshconfig = { path = "/home/hadi/.ssh/config"; };
|
||||||
|
github-key = { path = "/home/hadi/.ssh/github"; };
|
||||||
|
gitlab-key = { path = "/home/hadi/.ssh/gitlab"; };
|
||||||
|
jack-key = { path = "/home/hadi/.ssh/jack"; };
|
||||||
|
pia = { path = "/home/hadi/.config/pia/pia.ovpn"; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
home.file.".config/nixos/.sops.yaml".text = ''
|
||||||
|
keys:
|
||||||
|
- &primary age12yvtj49pfh3fqzqflscm0ek4yzrjhr6cqhn7x89gdxnlykq0xudq5c7334
|
||||||
|
creation_rules:
|
||||||
|
- path_regex: hosts/laptop/secrets/secrets.yaml$
|
||||||
|
key_groups:
|
||||||
|
- age:
|
||||||
|
- *primary
|
||||||
|
- path_regex: hosts/server/secrets/secrets.yaml$
|
||||||
|
key_groups:
|
||||||
|
- age:
|
||||||
|
- *primary
|
||||||
|
'';
|
||||||
|
|
||||||
|
systemd.user.services.mbsync.Unit.After = [ "sops-nix.service" ];
|
||||||
|
home.packages = with pkgs; [ sops age ];
|
||||||
|
|
||||||
|
wayland.windowManager.hyprland.settings.exec-once =
|
||||||
|
[ "systemctl --user start sops-nix" ];
|
||||||
|
}
|
||||||
25
hosts/desktop/secrets/secrets.yaml
Normal file
25
hosts/desktop/secrets/secrets.yaml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
pia: ENC[AES256_GCM,data:0bnhHeVqKSLHVimd78a94ShHlO3+LUoZ4oiKD3cnBYkaZsw=,iv:S+/IChlFlqdI+PyFF+Ti4AJUkch2MS0qKiqHL1Q3RMk=,tag:+v2kV70ou84eIc01dKnAhA==,type:str]
|
||||||
|
sshconfig: ENC[AES256_GCM,data:/sDTGVeYRjxF5Epp5kmVS0ScSYOqOs2grX0+Ap8HJc8CQftpNOYXNYdEyqLDM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MckGx6/LbxKFgrxnifRlsK3kWd28v2bRGVQOghUluYUtVkaJ+eh6o6ik0NQKx8/H6BznBSDE6MjDwbLv434LHBfDtAqhWN1eMbOlunFivsl5Hb/6rl9kydHlcCS6FY8cUHoKQ90gDaUuDrvUifwmdO5hU0GH5tgvGi1ReK9ndcpQsrHptG6,iv:oC1xU5Tu3The105VYRmxIw4kEwDoqe8T/EH6mmqpqwQ=,tag:Pu8c536u6W7ALrqjRsvXDw==,type:str]
|
||||||
|
sops:
|
||||||
|
kms: []
|
||||||
|
gcp_kms: []
|
||||||
|
azure_kv: []
|
||||||
|
hc_vault: []
|
||||||
|
age:
|
||||||
|
- recipient: age12yvtj49pfh3fqzqflscm0ek4yzrjhr6cqhn7x89gdxnlykq0xudq5c7334
|
||||||
|
enc: |
|
||||||
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
|
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBHVWN4YjZqczB3Q21WL1lz
|
||||||
|
ckROWkhRditHblVHVEpOS0E0aGVqdW14M0ZvCkNzRXlCOWFBWmQwTGpTYVdFRlpq
|
||||||
|
bFdOR2pSTEZpUVpvUHo2NklrQm5EU1kKLS0tIFZ5ZWhYcHg1Z0hTOTZIdHR1QUxv
|
||||||
|
cmVxVC8rVDlWMUdZaGw3bmdOaWZGS1EKYahBlc8XpB5UdKZQkvxbLcKQ/xkFJjWo
|
||||||
|
FSfQWnjhe/a7BJtJEcKZkjOQU0mYqlSu+uT2RA9diCQeRUJPRF+nAw==
|
||||||
|
-----END AGE ENCRYPTED FILE-----
|
||||||
|
lastmodified: "2024-11-05T12:05:15Z"
|
||||||
|
mac: ENC[AES256_GCM,data:ggTUKhmfUp4CCE6w3uiuwV0ys6xUhaMBeXi4WiaxkED/lB9iUdP9UssE9iF5lToyNxt/6O2C60CXc4OvpqBxe5dsxPkVNeB6PNhQrD5Ga8+Cu0i6hKz6Fmm0Rq461OuX0Nu2Nl3MUBCWxjM0+1ywfLRKDcjoVC7RzP5eo1NtrV8=,iv:G+Ntog1claKwAY4PEpUK1hjNzspDZiO3bdWNxugUXDQ=,tag:Yg2ZJEV2VrnTmpw8TykmZg==,type:str]
|
||||||
|
pgp: []
|
||||||
|
unencrypted_suffix: _unencrypted
|
||||||
|
version: 3.9.1
|
||||||
28
hosts/desktop/variables.nix
Normal file
28
hosts/desktop/variables.nix
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{ config, ... }: {
|
||||||
|
imports = [ ../../nixos/variables-config.nix ];
|
||||||
|
|
||||||
|
config.var = {
|
||||||
|
hostname = "desktop";
|
||||||
|
username = "hadi";
|
||||||
|
configDirectory = "/home/" + config.var.username
|
||||||
|
+ "/.config/nixos"; # The path of the nixos configuration directory
|
||||||
|
|
||||||
|
keyboardLayout = "fr";
|
||||||
|
|
||||||
|
location = "Paris";
|
||||||
|
timeZone = "Europe/Paris";
|
||||||
|
defaultLocale = "en_US.UTF-8";
|
||||||
|
extraLocale = "fr_FR.UTF-8";
|
||||||
|
|
||||||
|
git = {
|
||||||
|
username = "Hadi";
|
||||||
|
email = "112569860+anotherhadi@users.noreply.github.com";
|
||||||
|
};
|
||||||
|
|
||||||
|
autoUpgrade = false;
|
||||||
|
autoGarbageCollector = false;
|
||||||
|
|
||||||
|
# Choose your theme variables here
|
||||||
|
theme = import ../../themes/var/pinky.nix;
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user