add config for work.nix

This commit is contained in:
2025-09-25 20:36:34 +02:00
parent c3289c173e
commit 18491dd596
18 changed files with 268 additions and 34 deletions

View File

@@ -86,3 +86,6 @@ On lance le rebuild :
```
nixos-rebuild switch --flake ~/dev#test-kvm --target-host beastie@192.168.122.204 --sudo
```
## TODO
1. simplifier pkgs.rofi dans la conf du au merge rofi et rofi-wayland

12
flake.lock generated
View File

@@ -23,17 +23,17 @@
"mysecrets": {
"flake": false,
"locked": {
"lastModified": 1758040565,
"narHash": "sha256-Mq2BEI6ik6W49mSBotPi4zva6CyjXqdft+A7hy4ENGw=",
"lastModified": 1758805800,
"narHash": "sha256-gpsVmfnAx5WvuJccSEFFCGQauVwTtMOvNX8MU2rAh9g=",
"ref": "refs/heads/main",
"rev": "4640274dc3767b3f8b968f801f9f8e3be0619415",
"revCount": 3,
"rev": "e323fa4ec284046bd64842e70123ffadfa2b859f",
"revCount": 6,
"type": "git",
"url": "file:///home/beastie/nixos-secrets"
"url": "file:///home/beastie/nixos/secrets"
},
"original": {
"type": "git",
"url": "file:///home/beastie/nixos-secrets"
"url": "file:///home/beastie/nixos/secrets"
}
},
"nixpkgs": {

View File

@@ -15,7 +15,7 @@
};
mysecrets = {
url = "git+file:///home/beastie/nixos-secrets";
url = "git+file:///home/beastie/nixos/secrets";
flake = false;
};
};
@@ -49,6 +49,7 @@
generic = mkSystem inputs.nixpkgs "x86_64-linux" "generic" "beastie";
test-kvm = mkSystem inputs.nixpkgs "x86_64-linux" "test-kvm" "beastie";
home-nix = mkSystem inputs.nixpkgs "x86_64-linux" "home-nix" "beastie";
work-nix = mkSystem inputs.nixpkgs "x86_64-linux" "work-nix" "beastie";
# live-usb = mkSystem inputs.nixpkgs "x86_64-linux" "live-usb" "beastie";
#nixos-rebuild switch --flake ./#home-nix --sudo
};

View File

@@ -6,7 +6,7 @@
disk = {
main = {
type = "disk";
device = "/dev/vda";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {

View File

@@ -36,21 +36,4 @@
];
};
};
## Enable virtualisation guest settings
services.qemuGuest.enable = true;
services.spice-vdagentd.enable = true;
services.xserver = {
videoDrivers = [ "modesetting" ]; # Driver vidéo optimisé pour QEMU/KVM
};
environment.systemPackages = [
pkgs.spice-gtk # Outils SPICE
pkgs.spice-protocol # Protocoles SPICE
];
#fileSystems."/" = {
# device = "/dev/vda2"; # Disque virtuel typique
# fsType = "btrfs";
#};
}

View File

@@ -6,7 +6,7 @@
disk = {
main = {
type = "disk";
device = "/dev/vda";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {

View File

@@ -0,0 +1,38 @@
{
pkgs,
username,
hostname,
modulesPath,
inputs,
...
}:
{
system.stateVersion = "25.11";
imports = builtins.trace "${inputs.mysecrets}" [
(modulesPath + "/installer/scan/not-detected.nix")
./network.nix
./hardware-configuration.nix
../../modules/core
../../modules/optionnals/hosts/${hostname}.nix
];
boot.kernelPackages = pkgs.linuxPackages_latest;
time.timeZone = "Europe/Paris";
nix = {
settings = {
## Enable flakes
experimental-features = [
"nix-command"
"flakes"
];
## Users trusted to use flake command
trusted-users = [
"root"
"${username}"
];
};
};
}

View File

@@ -0,0 +1,37 @@
# 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" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/mapper/rootfs";
fsType = "btrfs";
options = [ "discard=async" "compress=zstd" ];
};
boot.initrd.luks.devices."rootfs" = {
device = "/dev/disk/by-uuid/6b1c7ee5-6489-4c47-bb8b-2e663e493aed";
allowDiscards = true;
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/B210-971B";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -0,0 +1,11 @@
{
hostname,
...
}:
{
networking = {
hostName = "${hostname}";
networkmanager.enable = true;
firewall.enable = true;
};
}

View File

@@ -15,6 +15,7 @@
pkgs.unzip
pkgs.sops
pkgs.ssh-to-age
pkgs.efibootmgr
];
services = {
locate = {

View File

@@ -0,0 +1,9 @@
{
...
}:
{
hardware.graphics = {
enable = true;
enable32Bit = true;
};
}

View File

@@ -0,0 +1,15 @@
################
### MONITORS ###
################
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=eDP-1,1920x1200,0x0,1
workspace = 1, monitor:eDP-1
workspace = 2, monitor:eDP-1
workspace = 3, monitor:eDP-1
workspace = 4, monitor:eDP-1
workspace = 5, monitor:eDP-1
workspace = 6, monitor:eDP-1
workspace = 7, monitor:eDP-1
workspace = 8, monitor:eDP-1
workspace = 9, monitor:eDP-1

View File

@@ -194,9 +194,7 @@ input {
}
# https://wiki.hyprland.org/Configuring/Variables/#gestures
gestures {
workspace_swipe = false
}
gesture = 3, horizontal, workspace
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
@@ -260,6 +258,7 @@ bind = $mainMod, KP_Begin, workspace, 5
bind = $mainMod, KP_Right, workspace, 6
bind = $mainMod, KP_Home, workspace, 7
bind = $mainMod, KP_Up, workspace, 8
bind = $mainMod, KP_Prior, workspace, 9
# Déplacement de fenêtre avec keypad
bind = $mainMod CONTROL, KP_End, movetoworkspacesilent, 1
@@ -270,6 +269,7 @@ bind = $mainMod CONTROL, KP_Begin, movetoworkspacesilent, 5
bind = $mainMod CONTROL, KP_Right, movetoworkspacesilent, 6
bind = $mainMod CONTROL, KP_Home, movetoworkspacesilent, 7
bind = $mainMod CONTROL, KP_Up, movetoworkspacesilent, 8
bind = $mainMod CONTROL, KP_Prior, movetoworkspacesilent, 9
# Example special workspace (scratchpad)
bind = $mainMod, S, togglespecialworkspace, magic

View File

@@ -73,8 +73,9 @@
"all-outputs": false,
"on-click": "activate",
"persistent-workspaces": {
"HDMI-A-1": [1, 2, 3, 4],
"HDMI-A-2": [5, 6, 7, 8],
"HDMI-A-1": [1, 2, 3],
"HDMI-A-2": [4, 5, 6],
"eDP-1": [7, 8, 9],
},
"format": "{name}",
"format-icons": {

View File

@@ -31,5 +31,4 @@
'';
};
};
}

View File

@@ -0,0 +1,113 @@
{
pkgs,
...
}:
{
programs.starship = {
enable = true;
settings = {
add_newline = true;
command_timeout = 1300;
scan_timeout = 50;
format = "$hostname$username$directory[](bg:pink fg:green)$nix_shell$git_branch$git_status[ ](bg:pink)[](fg:pink)$line_break$character";
palette = "catppuccin_frappe";
palettes.catppuccin_frappe = {
rosewater = "#f2d5cf";
flamingo = "#eebebe";
pink = "#f4b8e4";
mauve = "#ca9ee6";
red = "#e78284";
maroon = "#ea999c";
peach = "#ef9f76";
yellow = "#e5c890";
green = "#a6d189";
teal = "#81c8be";
sky = "#99d1db";
sapphire = "#85c1dc";
blue = "#8caaee";
lavender = "#babbf1";
text = "#c6d0f5";
subtext1 = "#b5bfe2";
subtext0 = "#a5adce";
overlay2 = "#949cbb";
overlay1 = "#838ba7";
overlay0 = "#737994";
surface2 = "#626880";
surface1 = "#51576d";
surface0 = "#414559";
base = "#303446";
mantle = "#292c3c";
crust = "#232634";
};
hostname = {
ssh_only = false;
ssh_symbol = "󰣀";
format = "(bg:blue fg:base)[ $ssh_symbol $hostname ](bg:blue fg:base)[](bg:teal fg:blue)";
trim_at = "companyname.com";
disabled = false;
};
username = {
show_always = true;
style_user = "bg:teal fg:base";
style_root = "bg:red fg:base";
format = "[ $user ]($style)[](bg:green fg:teal)";
};
directory = {
style = "bg:green fg:base";
format = "[ $path ]($style)";
truncation_length = 3;
truncation_symbol = "/";
};
nix_shell = {
disabled = false;
impure_msg = "[impure shell](bold red)";
pure_msg = "[pure shell](bold green)";
unknown_msg = "[unknown shell](bold yellow)";
format = "[ ($name)](bold bg:pink fg:base)";
};
directory.substitutions = {
Documents = "󰈙 ";
Downloads = " Downloads";
Music = "󰝚 ";
Pictures = " ";
Developer = "󰲋 ";
};
git_branch = {
symbol = "";
style = "bg: pink";
format = "[[ $symbol $branch ](bg:pink fg:base)]($style)";
};
git_status = {
style = "bg:pink fg:base";
format = "([$modified$untracked$ahead_behind]($style))";
ahead = "";
behind = "";
modified = "";
untracked = "";
up_to_date = "";
};
line_break = {
disabled = false;
};
character = {
disabled = false;
success_symbol = "[](bold fg:green)";
error_symbol = "[](bold fg:red)";
vimcmd_symbol = "[](bold fg:creen)";
vimcmd_replace_one_symbol = "[](bold fg:purple)";
vimcmd_replace_symbol = "[](bold fg:purple)";
vimcmd_visual_symbol = "[](bold fg:lavender)";
};
};
};
}

View File

@@ -24,12 +24,12 @@
etc = {
"xdg/hypr/frappe.conf".source = ./config/etc/xdg/hypr/frappe.conf;
"xdg/hypr/hyprland.conf".source = ./config/etc/xdg/hypr/hyprland.conf;
"xdg/hypr/hyprland-host.conf".source = ./config/etc/xdg/hypr/hyperland-${hostname}.conf;
"xdg/hypr/hyprland-host.conf".source = ./config/etc/xdg/hypr/hyprland-${hostname}.conf;
"xdg/hypr/hyprlock.conf".source = ./config/etc/xdg/hypr/hyprlock.conf;
"xdg/hypr/hyprpaper.conf".source = ./config/etc/xdg/hypr/hyprpaper.conf;
"xdg/hypr/rofi.conf" = {
text = ''
$rofi = ${pkgs.rofi-wayland}/bin/rofi -show drun -show-icons -config /etc/xdg/rofi/config.rasi
$rofi = ${pkgs.rofi}/bin/rofi -show drun -show-icons -config /etc/xdg/rofi/config.rasi
'';
};
"xdg/waybar".source = ./config/etc/xdg/waybar;

View File

@@ -0,0 +1,23 @@
{
...
}:
{
imports = [
../sops-desktop.nix
../sudo-nopasswd.nix
../autologin.nix
../ssh.nix
### Import GUI modules
../desktop/dunst.nix
../desktop/kitty.nix
../desktop/packages.nix
../desktop/qwerty-fr.nix
../desktop/rofi.nix
../desktop/starship.nix
../desktop/wayland.nix
### Import Graphics modules
../desktop/amd.nix
];
}