Compare commits

...

15 Commits

Author SHA1 Message Date
ff17f33531 Creating kvm test server 2025-11-22 13:05:42 +01:00
59b184cc2c before flake update 2025-11-21 10:17:59 +01:00
Jérémie SALVI
a925119154 flake update 2025-11-08 15:14:53 +01:00
Jérémie SALVI
e406793840 flake update 2025-11-08 15:10:23 +01:00
Jérémie SALVI
9c0bf5fabf add libvirt and virt manager 2025-10-29 21:27:18 +01:00
Jérémie SALVI
7fa9f95ce4 after flake update 2025-10-29 14:26:06 +01:00
Jérémie SALVI
e5e4fe04ea after flake update 2025-10-28 14:17:30 +01:00
73cc922bed Add aider 2025-10-20 12:51:18 +02:00
3e07666c13 after flake update 2025-10-20 11:36:11 +02:00
b4cd147221 add autosuggestions to zsh 2025-10-20 03:30:41 +02:00
4a65f5e537 use only nmcli with nmaplet 2025-10-16 00:29:12 +02:00
Jérémie SALVI
f16f941daf use only nmcli 2025-10-16 00:19:15 +02:00
Jérémie SALVI
24fa6a4700 some work improvments 2025-10-15 23:22:24 +02:00
3b74e79fed Change waybar colors 2025-10-13 20:29:02 +02:00
18cc8751c9 Improve waybar and custom scripts 2025-10-13 20:23:43 +02:00
36 changed files with 602 additions and 288 deletions

51
flake.lock generated
View File

@@ -3,15 +3,15 @@
"disko": { "disko": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs-unstable"
] ]
}, },
"locked": { "locked": {
"lastModified": 1758287904, "lastModified": 1763651264,
"narHash": "sha256-IGmaEf3Do8o5Cwp1kXBN1wQmZwQN3NLfq5t4nHtVtcU=", "narHash": "sha256-8vvwZbw0s7YvBMJeyPVpWke6lg6ROgtts5N2/SMCcv4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "67ff9807dd148e704baadbd4fd783b54282ca627", "rev": "e86a89079587497174ccab6d0d142a65811a4fd9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -23,11 +23,11 @@
"mysecrets": { "mysecrets": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1759883911, "lastModified": 1763731770,
"narHash": "sha256-IAKCQ9dIeMAdoi4fQdJAdWlLrNh/PURqGz7pmlo9cUw=", "narHash": "sha256-ThIVf8jtBOKV7JzShnL/gzHEm7axiLshPie8BYkMYAI=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "7e39f4cde171d9273efddf2153d972d6fbf2a710", "rev": "07b3f415bd89a6b571f154278c1d9b6b5ca9e473",
"revCount": 15, "revCount": 16,
"type": "git", "type": "git",
"url": "file:///home/beastie/nixos/secrets" "url": "file:///home/beastie/nixos/secrets"
}, },
@@ -36,13 +36,29 @@
"url": "file:///home/beastie/nixos/secrets" "url": "file:///home/beastie/nixos/secrets"
} }
}, },
"nixpkgs": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1760038930, "lastModified": 1763622513,
"narHash": "sha256-Oncbh0UmHjSlxO7ErQDM3KM0A5/Znfofj2BSzlHLeVw=", "narHash": "sha256-1jQnuyu82FpiSxowrF/iFK6Toh9BYprfDqfs4BB+19M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c58bc7f5459328e4afac201c5c4feb7c818d604b",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1763421233,
"narHash": "sha256-Stk9ZYRkGrnnpyJ4eqt9eQtdFWRRIvMxpNRf4sIegnw=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0b4defa2584313f3b781240b29d61f6f9f7e0df3", "rev": "89c2b2330e733d6cdb5eae7b899326930c2c0648",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -56,22 +72,23 @@
"inputs": { "inputs": {
"disko": "disko", "disko": "disko",
"mysecrets": "mysecrets", "mysecrets": "mysecrets",
"nixpkgs": "nixpkgs", "nixpkgs-stable": "nixpkgs-stable",
"nixpkgs-unstable": "nixpkgs-unstable",
"sops-nix": "sops-nix" "sops-nix": "sops-nix"
} }
}, },
"sops-nix": { "sops-nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs-unstable"
] ]
}, },
"locked": { "locked": {
"lastModified": 1759635238, "lastModified": 1763607916,
"narHash": "sha256-UvzKi02LMFP74csFfwLPAZ0mrE7k6EiYaKecplyX9Qk=", "narHash": "sha256-VefBA1JWRXM929mBAFohFUtQJLUnEwZ2vmYUNkFnSjE=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "6e5a38e08a2c31ae687504196a230ae00ea95133", "rev": "877bb495a6f8faf0d89fc10bd142c4b7ed2bcc0b",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -2,16 +2,17 @@
description = "A very basic flake"; description = "A very basic flake";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
disko = { disko = {
url = "github:nix-community/disko"; url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs-unstable";
}; };
sops-nix = { sops-nix = {
url = "github:Mic92/sops-nix"; url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs-unstable";
}; };
mysecrets = { mysecrets = {
@@ -46,10 +47,10 @@
{ {
nixosConfigurations = { nixosConfigurations = {
#nixos-anywhere -- --flake './#generic' --generate-hardware-config nixos-generate-config ./hosts/generic/hardware-configuration.nix --target-host beastie@192.168.122.204 #nixos-anywhere -- --flake './#generic' --generate-hardware-config nixos-generate-config ./hosts/generic/hardware-configuration.nix --target-host beastie@192.168.122.204
generic = mkSystem inputs.nixpkgs "x86_64-linux" "generic" "beastie"; generic = mkSystem inputs.nixpkgs-stable "x86_64-linux" "generic" "beastie";
test-kvm = mkSystem inputs.nixpkgs "x86_64-linux" "test-kvm" "beastie"; test-kvm = mkSystem inputs.nixpkgs-stable "x86_64-linux" "test-kvm" "beastie";
home-nix = mkSystem inputs.nixpkgs "x86_64-linux" "home-nix" "beastie"; home-nix = mkSystem inputs.nixpkgs-unstable "x86_64-linux" "home-nix" "beastie";
work-nix = mkSystem inputs.nixpkgs "x86_64-linux" "work-nix" "beastie"; work-nix = mkSystem inputs.nixpkgs-unstable "x86_64-linux" "work-nix" "beastie";
# live-usb = mkSystem inputs.nixpkgs "x86_64-linux" "live-usb" "beastie"; # live-usb = mkSystem inputs.nixpkgs "x86_64-linux" "live-usb" "beastie";
#nixos-rebuild switch --flake ./#home-nix --sudo #nixos-rebuild switch --flake ./#home-nix --sudo
}; };

View File

@@ -5,7 +5,7 @@
... ...
}: }:
{ {
system.stateVersion = "25.11"; system.stateVersion = "25.05";
imports = [ imports = [
./disk-config.nix ./disk-config.nix
@@ -83,6 +83,7 @@
pkgs.nixos-anywhere pkgs.nixos-anywhere
pkgs.nixos-generators pkgs.nixos-generators
pkgs.ssh-to-age pkgs.ssh-to-age
pkgs.htop
]; ];
services.openssh.enable = true; services.openssh.enable = true;

View File

@@ -6,7 +6,7 @@
disk = { disk = {
main = { main = {
type = "disk"; type = "disk";
device = "/dev/nvme0n1"; device = "/dev/vda";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
@@ -23,42 +23,88 @@
}; };
SYS = { SYS = {
size = "100%"; size = "100%";
type = "8309"; type = "8300";
name = "SYS"; name = "SYS";
content = { content = {
type = "luks"; type = "btrfs";
name = "rootfs"; extraArgs = [ "-f --nodiscard --label root" ];
settings = { subvolumes = {
allowDiscards = true; "@" = {
}; mountpoint = "/";
content = { mountOptions = [
type = "btrfs"; "defaults"
extraArgs = [ "-f --nodiscard --label root" ]; "ssd"
subvolumes = { "compress=zstd"
"@" = { "autodefrag"
mountpoint = "/"; "noatime"
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ]; "nodiscard"
}; ];
"@root" = { };
mountpoint = "/root"; "@root" = {
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ]; mountpoint = "/root";
}; mountOptions = [
"@home" = { "defaults"
mountpoint = "/home"; "ssd"
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ]; "compress=zstd"
}; "autodefrag"
"@nix" = { "noatime"
mountpoint = "/nix"; "nodiscard"
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ]; ];
}; };
"@var" = { "@home" = {
mountpoint = "/var"; mountpoint = "/home";
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ]; mountOptions = [
}; "defaults"
"@games" = { "ssd"
mountpoint = "/games"; "compress=zstd"
mountOptions = [ "defaults" "ssd" "compress=zstd" "autodefrag" "noatime" "nodiscard" ]; "autodefrag"
}; "noatime"
"nodiscard"
];
};
"@nix" = {
mountpoint = "/nix";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@var" = {
mountpoint = "/var";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@data" = {
mountpoint = "/games";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@backups" = {
mountpoint = "/games";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
}; };
}; };
}; };

View File

@@ -5,14 +5,13 @@
{ {
imports = imports =
[ (modulesPath + "/installer/scan/not-detected.nix") [ (modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

View File

@@ -1,6 +1,4 @@
{ {
pkgs,
username,
hostname, hostname,
modulesPath, modulesPath,
inputs, inputs,

View File

@@ -7,50 +7,13 @@
... ...
}: }:
{ {
system.stateVersion = "25.11"; system.stateVersion = "25.05";
imports = builtins.trace "${inputs.mysecrets}" [ imports = builtins.trace "${inputs.mysecrets}" [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
./network.nix
./disk-config.nix ./disk-config.nix
./hardware-configuration.nix ./hardware-configuration.nix
../../modules/core ../../modules/core
../../modules/optionnals/hosts/${hostname}.nix ../../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}"
];
};
};
## 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

@@ -10,22 +10,103 @@
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
ESP = { EFI = {
size = "512M"; size = "512M";
type = "EF00"; type = "EF00";
name = "EFI";
content = { content = {
type = "filesystem"; type = "filesystem";
format = "vfat"; format = "vfat";
mountpoint = "/boot"; mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
}; };
}; };
root = { SYS = {
size = "100%"; size = "100%";
type = "8300"; type = "8300";
name = "SYS";
content = { content = {
type = "filesystem"; type = "btrfs";
format = "btrfs"; extraArgs = [ "-f --nodiscard --label root" ];
mountpoint = "/"; subvolumes = {
"@" = {
mountpoint = "/";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@root" = {
mountpoint = "/root";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@home" = {
mountpoint = "/home";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@nix" = {
mountpoint = "/nix";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@var" = {
mountpoint = "/var";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@data" = {
mountpoint = "/games";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
"@backups" = {
mountpoint = "/games";
mountOptions = [
"defaults"
"ssd"
"compress=zstd"
"autodefrag"
"noatime"
"nodiscard"
];
};
};
}; };
}; };
}; };

View File

@@ -1,38 +1,16 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ { config, lib, pkgs, modulesPath, ... }:
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = [ imports =
(modulesPath + "/profiles/qemu-guest.nix") [ (modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
"ahci" boot.initrd.kernelModules = [ ];
"xhci_pci" boot.kernelModules = [ "kvm-intel" ];
"virtio_pci"
"sr_mod"
"virtio_blk"
"virtio_scsi"
"virtio_net"
"virtio_blk"
];
boot.initrd.kernelModules = [
"virtio_balloon"
"virtio_console"
"virtio_rng"
];
boot.kernelModules = [
"kvm-intel"
"virtio-gpu"
];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";

View File

@@ -1,6 +1,4 @@
{ {
pkgs,
username,
hostname, hostname,
modulesPath, modulesPath,
inputs, inputs,

View File

@@ -23,6 +23,7 @@
pkgs.jq pkgs.jq
pkgs.bash pkgs.bash
pkgs.fzf pkgs.fzf
pkgs.bc
]; ];
services = { services = {
locate = { locate = {

View File

@@ -2,8 +2,6 @@
pkgs, pkgs,
username, username,
hostname, hostname,
modulesPath,
inputs,
... ...
}: }:
{ {
@@ -23,12 +21,14 @@
"root" "root"
"${username}" "${username}"
]; ];
## Use 24 cores during building phases
cores = 24;
max-jobs = "auto";
}; };
}; };
networking = { networking = {
hostName = "${hostname}"; hostName = "${hostname}";
networkmanager.enable = true;
firewall.enable = true; firewall.enable = true;
}; };
} }

View File

@@ -17,6 +17,7 @@
df = "df -h"; df = "df -h";
du = "du -h"; du = "du -h";
}; };
# Defined in /etc/set-environnement. Require session restart
variables = { variables = {
XDG_CONFIG_HOME = "$HOME/.config"; XDG_CONFIG_HOME = "$HOME/.config";
XDG_CACHE_HOME = "$HOME/.cache"; XDG_CACHE_HOME = "$HOME/.cache";
@@ -33,22 +34,12 @@
enable = true; enable = true;
enableCompletion = true; enableCompletion = true;
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
autosuggestions.enable = false; autosuggestions.enable = true;
histSize = 200000; histSize = 200000;
histFile = "$HOME/.config/zsh/.zsh_history"; histFile = "$HOME/.config/zsh/.zsh_history";
setOptions = [ setOptions = [
"SHARE_HISTORY" "SHARE_HISTORY"
]; ];
# shellInit = ''
# export XDG_CONFIG_HOME=$HOME/.config
# export XDG_CACHE_HOME=$HOME/.cache
# export XDG_DATA_HOME=$HOME/.local/share
# export ZDOTDIR=$HOME/.config/zsh
# export TERMINAL=kitty
# export EDITOR=nvim
# export BROWSER=firefox
# export SAVEHIST=200000
# '';
promptInit = '' promptInit = ''
stty stop undef # Disable ctrl+s to freeze terminal stty stop undef # Disable ctrl+s to freeze terminal
@@ -59,6 +50,9 @@
zstyle ':completion:*' menu select zstyle ':completion:*' menu select
zmodload zsh/complist zmodload zsh/complist
# enable dotfiles in tab directory completion
setopt globdots
fzf-history() { fzf-history() {
local selected local selected
selected=$(fc -l 1 | fzf --tac --no-sort | sed 's/^[ ]*[0-9]*[ ]*//') selected=$(fc -l 1 | fzf --tac --no-sort | sed 's/^[ ]*[0-9]*[ ]*//')

View File

@@ -14,7 +14,6 @@
description = "Admin account"; description = "Admin account";
extraGroups = [ extraGroups = [
"wheel" "wheel"
"networkmanager"
"audio" "audio"
"video" "video"
]; ];

View File

@@ -14,27 +14,33 @@
OLLAMA_KEEP_ALIVE = "5m"; OLLAMA_KEEP_ALIVE = "5m";
}; };
}; };
# services.open-webui = {
services.open-webui = { # enable = true;
enable = true; # port = 8080; # Port par défaut
port = 8080; # Port par défaut # host = "127.0.0.1"; # Localhost uniquement
host = "127.0.0.1"; # Localhost uniquement # openFirewall = true;
openFirewall = true; # # Pour accès réseau : host = "0.0.0.0";
# Pour accès réseau : host = "0.0.0.0"; # environment = {
environment = { # ANONYMIZED_TELEMETRY = "True";
ANONYMIZED_TELEMETRY = "True"; # DO_NOT_TRACK = "True";
DO_NOT_TRACK = "True"; # SCARF_NO_ANALYTICS = "True";
SCARF_NO_ANALYTICS = "True"; # # URL d'Ollama (local)
# URL d'Ollama (local) # OLLAMA_BASE_URL = "http://127.0.0.1:11434";
OLLAMA_BASE_URL = "http://127.0.0.1:11434"; # # Autres options optionnelles (https://docs.openwebui.com/getting-started/env-configuration/#web-search)
# Autres options optionnelles (https://docs.openwebui.com/getting-started/env-configuration/#web-search) # WEBUI_AUTH = "False"; # Desactive l'authentification
WEBUI_AUTH = "False"; # Desactive l'authentification # # ENABLE_WEB_SEARCH = "True";
# ENABLE_WEB_SEARCH = "True"; # # ENABLE_SEARCH_QUERY_GENERATION = "True";
# ENABLE_SEARCH_QUERY_GENERATION = "True"; # # WEB_SEARCH_ENGINE = "duckduckgo";
# WEB_SEARCH_ENGINE = "duckduckgo"; # # WEB_LOADER_ENGINE = "safe_web";
# WEB_LOADER_ENGINE = "safe_web"; # };
# };
environment = {
systemPackages = [
pkgs.lmstudio
pkgs.aider-chat-full
];
variables = {
OLLAMA_API_BASE = "http://localhost:11434";
}; };
}; };
environment.systemPackages = [ pkgs.lmstudio ];
} }

View File

@@ -74,7 +74,7 @@ in
(pkgs.vscode-with-extensions.override { (pkgs.vscode-with-extensions.override {
vscode = pkgs.vscodium; vscode = pkgs.vscodium;
vscodeExtensions = [ vscodeExtensions = [
pkgs.vscode-extensions.continue.continue # pkgs.vscode-extensions.continue.continue
pkgs.vscode-extensions.catppuccin.catppuccin-vsc pkgs.vscode-extensions.catppuccin.catppuccin-vsc
pkgs.vscode-extensions.catppuccin.catppuccin-vsc-icons pkgs.vscode-extensions.catppuccin.catppuccin-vsc-icons
pkgs.vscode-extensions.jnoortheen.nix-ide pkgs.vscode-extensions.jnoortheen.nix-ide

View File

@@ -14,7 +14,6 @@ ecosystem {
################### ###################
$terminal = kitty $terminal = kitty
source = /etc/xdg/hypr/rofi.conf
################# #################
### AUTOSTART ### ### AUTOSTART ###
@@ -211,9 +210,10 @@ device {
$mainMod = SUPER # Sets "Windows" key as main modifier $mainMod = SUPER # Sets "Windows" key as main modifier
# Apps shortcut # Apps shortcut
bind = $mainMod, D, exec, $rofi bind = $mainMod, D, exec, rofi -show drun -show-icons -config /etc/xdg/rofi/config.rasi
bind = $mainMod, L, exec, /etc/xdg/scripts/wayland-disconnect.sh bind = $mainMod, L, exec, /etc/xdg/scripts/wayland-disconnect.sh
bind = $mainMod, M, exec, /etc/xdg/scripts/wayland-mpv.sh bind = $mainMod, M, exec, /etc/xdg/scripts/wayland-mpv.sh
bind = $mainMod, K, exec, /etc/xdg/scripts/rofi-ssh.sh
bind = $mainMod SHIFT, P, exec, pavucontrol bind = $mainMod SHIFT, P, exec, pavucontrol
bind = $mainMod SHIFT, T, exec, teams-for-linux bind = $mainMod SHIFT, T, exec, teams-for-linux
bind = $mainMod SHIFT, D, exec, discord bind = $mainMod SHIFT, D, exec, discord

View File

@@ -0,0 +1,16 @@
@import "launcher.rasi"
window {
width: 50%;
height: 50%;
margin: 0px;
location: center;
anchor: center;
}
mainbox {
children: [inputbar,listview];
}
listview {
columns: 1;
}

View File

@@ -0,0 +1,12 @@
@import "launcher.rasi"
window {
width: 50%;
height: 50%;
margin: 0px;
location: center;
anchor: center;
}
mainbox {
children: [inputbar,listview];
}

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
selected=$(cat ~/.config/zsh/.zsh_history | sed 's/^[ ]*[0-9]*[ ]*//' | grep '^ssh ' | rofi -dmenu -i -theme /etc/xdg/rofi/ssh.rasi -p SSH)
if [[ -n "$selected" ]]; then
kitty -e $selected
fi

View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
_USER=beastie
_PASSWD='}q6658JD~{}{oiRWsb~Q{P@SV=Qsy,ae'
_SERVER=unixyourbrain.org
_FOLDER=Admin
set -e
cd -- "$(dirname -- "$0")"
_DIRNAME="$(pwd)"
### Sourcer à partir des secrets
#source ~/.config/polybar/imap_creds
_COUNT=$(curl -u "$_USER:$_PASSWD" "imaps://$_SERVER" -X "STATUS $_FOLDER (UNSEEN)" 2>/dev/null | \
sed -e 's/)\r//' -e 's/.*UNSEEN //')
_UNSEEN=$(curl -u "$_USER:$_PASSWD" "imaps://$_SERVER/$_FOLDER" -X "SEARCH UNSEEN" 2>/dev/null | \
sed -e "s|\\r||" -e "s|* SEARCH ||" -e "s| |,|g")
_MAILS=$(curl -v -u "$_USER:$_PASSWD" "imaps://$_SERVER/$_FOLDER" -X "FETCH $_UNSEEN BODY.PEEK[HEADER.FIELDS (From Subject)]" 2>&1 | \
sed -e "s|\\r||" | awk '/< Subject|< From/ {sub(/^< /, ""); printf "%s\\n", $0}')
printf '{"text": "%s ", "tooltip": "%s"}' "$_COUNT" "$_MAILS"

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
selected=$(printf "Lock\0icon\x1fsystem-lock-screen
Update\0icon\x1fsystem-software-update
Shutdown\0icon\x1fsystem-shutdown
Reboot\0icon\x1fsystem-reboot
Exit hyprland\0icon\x1fsystem-log-out
Reload hyprland\0icon\x1fsystem-log-out" | rofi -dmenu -show-icons -i -theme /etc/xdg/rofi/disconnect.rasi -p System)
echo "$selected"
case $selected in
"Lock")
/nix/store/4pwvyyjrc7frwkycbszakd7z6nf44qgv-hyprlock-0.9.2/bin/hyprlock
;;
"Update")
kitty /usr/local/share/dotfiles/scripts/update.sh
;;
"Shutdown")
systemctl poweroff
;;
"Reboot")
reboot
;;
"Exit hyprland")
hyprctl dispatch exit
;;
"Reload hyprland")
hyprctl reload
;;
esac

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
cd -- "$(dirname -- "$0")" || exit
## if not $1
if [[ -z $1 ]]
then
_LINES=$(curl "http://10.0.0.1:2013" 2>/dev/null | sed -e "s|.*<a href=\"\([^\"]*\).*|$1\1|" -e "s/.*<.*\|.*C=D.*\|.*\/\/$\|.*.nfo//" -e "/^$/d")
else
_LINES="$(curl "http://10.0.0.1:2013/$1" 2>/dev/null | sed -e "s|.*<a href=\"\([^\"]*\).*|$1\1|" -e "s/.*<.*\|.*C=D.*\|.*\/\/$\|.*.nfo//" -e "/^$/d")"
fi
_RESULT=$(rofi -dmenu -i -theme /etc/xdg/rofi/mpv.rasi -p Mpv <<< "$_LINES")
# If no output
echo "$_RESULT"
if [[ -z $_RESULT ]]
then
echo "no output, exiting"
exit 0
fi
#if line end vith /
if [[ "$_RESULT" =~ .*/$ ]]
then
echo "output is a directory"
./wayland-mpv.sh "$_RESULT"
exit 0
fi
mpv "http://10.0.0.1:2013/$_RESULT"

View File

@@ -7,12 +7,13 @@
"memory", "memory",
"disk", "disk",
"network", "network",
"pulseaudio", "pulseaudio"
], ],
"modules-center": [ "modules-center": [
"hyprland/workspaces" "hyprland/workspaces"
], ],
"modules-right": [ "modules-right": [
"custom/alert",
"custom/maj", "custom/maj",
"clock", "clock",
"tray" "tray"
@@ -78,11 +79,20 @@
}, },
"format": "{name}", "format": "{name}",
"format-icons": { "format-icons": {
"default": "", "default": ""
}, }
},
"custom/alert": {
"exec": "/etc/xdg/scripts/waybar-mailbox.sh",
"interval": 300,
"return-type": "json",
"format": "{icon}{text}",
"format-icons": {
"default": "  "
}
}, },
"custom/maj": { "custom/maj": {
"exec": "/etc/xdg/scripts/update.sh", "exec": "/etc/xdg/scripts/waybar-update.sh",
"interval": 300, "interval": 300,
"return-type": "json", "return-type": "json",
"format": "{icon}{text}", "format": "{icon}{text}",

View File

@@ -7,12 +7,13 @@
"memory", "memory",
"disk", "disk",
"network", "network",
"pulseaudio", "pulseaudio"
], ],
"modules-center": [ "modules-center": [
"hyprland/workspaces" "hyprland/workspaces"
], ],
"modules-right": [ "modules-right": [
"custom/alert",
"custom/maj", "custom/maj",
"clock", "clock",
"tray" "tray"
@@ -79,11 +80,20 @@
}, },
"format": "{name}", "format": "{name}",
"format-icons": { "format-icons": {
"default": "", "default": ""
}, }
},
"custom/alert": {
"exec": "/etc/xdg/scripts/waybar-mailbox.sh",
"interval": 300,
"return-type": "json",
"format": "{icon}{text}",
"format-icons": {
"default": "  "
}
}, },
"custom/maj": { "custom/maj": {
"exec": "/etc/xdg/scripts/update.sh", "exec": "/etc/xdg/scripts/waybar-update.sh",
"interval": 300, "interval": 300,
"return-type": "json", "return-type": "json",
"format": "{icon}{text}", "format": "{icon}{text}",

View File

@@ -24,6 +24,7 @@
#disk, #disk,
#network, #network,
#workspaces, #workspaces,
#custom-alert,
#custom-maj, #custom-maj,
#pulseaudio, #pulseaudio,
#memory, #memory,
@@ -87,24 +88,40 @@
background: @red; background: @red;
} }
#network { #custom-logo {
color: @pink; color: @red;
}
#pulseaudio {
color: @yellow;
} }
#cpu { #cpu {
color: @blue; color: @peach;
} }
#memory { #memory {
color: @green; color: @maroon;
}
#disk {
color: @pink;
}
#network {
color: @flamingo;
}
#pulseaudio {
color: @rosewater;
}
#custom-alert {
color: @sky;
}
#custom-maj {
color: @sapphire;
} }
#clock { #clock {
color: @red; color: @blue;
} }
#tray { #tray {

View File

@@ -6,78 +6,6 @@
environment = { environment = {
etc = { etc = {
"xdg/rofi".source = ./config/etc/xdg/rofi; "xdg/rofi".source = ./config/etc/xdg/rofi;
"xdg/scripts/wayland-disconnect.sh" = {
text = ''
#!/usr/bin/env bash
selected=$(printf "Lock\0icon\x1fsystem-lock-screen
Update\0icon\x1fsystem-software-update
Shutdown\0icon\x1fsystem-shutdown
Reboot\0icon\x1fsystem-reboot
Exit hyprland\0icon\x1fsystem-log-out
Reload hyprland\0icon\x1fsystem-log-out" | ${pkgs.rofi}/bin/rofi -dmenu -show-icons -i -theme /etc/xdg/rofi/disconnect.rasi -p System)
echo "$selected"
case $selected in
"Lock")
${pkgs.hyprlock}/bin/hyprlock
;;
"Update")
kitty /usr/local/share/dotfiles/scripts/update.sh
;;
"Shutdown")
systemctl poweroff
;;
"Reboot")
reboot
;;
"Exit hyprland")
hyprctl dispatch exit
;;
"Reload hyprland")
hyprctl reload
;;
esac
'';
mode = "0755";
};
"xdg/scripts/wayland-mpv.sh" = {
text = ''
#!/usr/bin/env bash
cd -- "$(dirname -- "$0")" || exit
## if not $1
if [[ -z $1 ]]
then
_LINES=$(curl "http://10.0.0.1:2013" 2>/dev/null | sed -e "s|.*<a href=\"\([^\"]*\).*|$1\1|" -e "s/.*<.*\|.*C=D.*\|.*\/\/$\|.*.nfo//" -e "/^$/d")
else
_LINES="$(curl "http://10.0.0.1:2013/$1" 2>/dev/null | sed -e "s|.*<a href=\"\([^\"]*\).*|$1\1|" -e "s/.*<.*\|.*C=D.*\|.*\/\/$\|.*.nfo//" -e "/^$/d")"
fi
_RESULT=$(${pkgs.rofi}/bin/rofi -dmenu -config /etc/xdg/rofi/config.rasi -i <<< "$_LINES")
# If no output
echo "$_RESULT"
if [[ -z $_RESULT ]]
then
echo "no output, exiting"
exit 0
fi
#if line end vith /
if [[ "$_RESULT" =~ .*/$ ]]
then
echo "output is a directory"
./wayland-mpv.sh "$_RESULT"
exit 0
fi
mpv "http://10.0.0.1:2013/$_RESULT"
'';
mode = "0755";
};
}; };
}; };
} }

View File

@@ -1,5 +1,4 @@
{ {
pkgs,
... ...
}: }:
{ {

View File

@@ -0,0 +1,7 @@
{
...
}:
{
programs.virt-manager.enable = true;
virtualisation.spiceUSBRedirection.enable = true;
}

View File

@@ -28,16 +28,16 @@
"xdg/hypr/hyprland-host.conf".source = ./config/etc/xdg/hypr/hyprland-${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/hyprlock.conf".source = ./config/etc/xdg/hypr/hyprlock.conf;
"xdg/hypr/hyprpaper.conf".source = ./config/etc/xdg/hypr/hyprpaper.conf; "xdg/hypr/hyprpaper.conf".source = ./config/etc/xdg/hypr/hyprpaper.conf;
"xdg/hypr/rofi.conf" = {
text = ''
$rofi = ${pkgs.rofi}/bin/rofi -show drun -show-icons -config /etc/xdg/rofi/config.rasi
'';
};
"xdg/waybar/colors.css".source = ./config/etc/xdg/waybar/colors.css; "xdg/waybar/colors.css".source = ./config/etc/xdg/waybar/colors.css;
"xdg/waybar/config.jsonc".source = ./config/etc/xdg/waybar/config-${hostname}.jsonc; "xdg/waybar/config.jsonc".source = ./config/etc/xdg/waybar/config-${hostname}.jsonc;
"xdg/waybar/style.css".source = ./config/etc/xdg/waybar/style.css; "xdg/waybar/style.css".source = ./config/etc/xdg/waybar/style.css;
"xdg/waybar/custom.css".source = ./config/etc/xdg/waybar/custom-${hostname}.css; "xdg/waybar/custom.css".source = ./config/etc/xdg/waybar/custom-${hostname}.css;
"xdg/scripts/update.sh".source = ./config/etc/xdg/scripts/update.sh;
"xdg/scripts/rofi-ssh.sh".source = ./config/etc/xdg/scripts/rofi-ssh.sh;
"xdg/scripts/waybar-mailbox.sh".source = ./config/etc/xdg/scripts/waybar-mailbox.sh;
"xdg/scripts/waybar-update.sh".source = ./config/etc/xdg/scripts/waybar-update.sh;
"xdg/scripts/wayland-disconnect.sh".source = ./config/etc/xdg/scripts/wayland-disconnect.sh;
"xdg/scripts/wayland-mpv.sh".source = ./config/etc/xdg/scripts/wayland-mpv.sh;
}; };
}; };
sops = { sops = {

View File

@@ -8,6 +8,7 @@
../ai.nix ../ai.nix
../autologin.nix ../autologin.nix
../k8s.nix ../k8s.nix
../libvirt.nix
../openfortivpn.nix ../openfortivpn.nix
../packages.nix ../packages.nix
../sops-desktop.nix ../sops-desktop.nix
@@ -23,6 +24,7 @@
../desktop/qwerty-fr.nix ../desktop/qwerty-fr.nix
../desktop/rofi.nix ../desktop/rofi.nix
../desktop/starship.nix ../desktop/starship.nix
../desktop/virt-manager.nix
../desktop/wayland.nix ../desktop/wayland.nix
### Import Graphics modules ### Import Graphics modules

View File

@@ -1,4 +1,5 @@
{ {
pkgs,
... ...
}: }:
{ {
@@ -6,14 +7,21 @@
../sops-desktop.nix ../sops-desktop.nix
../sudo-nopasswd.nix ../sudo-nopasswd.nix
../autologin.nix ../autologin.nix
../ssh.nix ../packages.nix
### Import GUI modules ## Server
../desktop/dunst.nix ../server/starship.nix
../desktop/kitty.nix ];
../desktop/packages.nix
../desktop/qwerty-fr.nix ## Enable virtualisation guest settings
../desktop/rofi.nix services.qemuGuest.enable = true;
../desktop/wayland.nix 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
]; ];
} }

View File

@@ -1,11 +1,12 @@
{ {
pkgs, username,
... ...
}: }:
{ {
imports = [ imports = [
../autologin.nix ../autologin.nix
../k8s.nix ../k8s.nix
../libvirt.nix
../openfortivpn.nix ../openfortivpn.nix
../packages.nix ../packages.nix
../sops-desktop.nix ../sops-desktop.nix
@@ -22,12 +23,21 @@
../desktop/qwerty-fr.nix ../desktop/qwerty-fr.nix
../desktop/rofi.nix ../desktop/rofi.nix
../desktop/starship.nix ../desktop/starship.nix
../desktop/virt-manager.nix
../desktop/wayland.nix ../desktop/wayland.nix
### Import Graphics modules ### Import Graphics modules
../desktop/amd.nix ../desktop/amd.nix
]; ];
networking.wireless.iwd.enable = true; networking = {
networkmanager.enable = true;
extraHosts = ''
carto-interavtive 172.18.20.134
'';
};
users.users.${username} = {
extraGroups = [ "networkmanager" ];
};
programs.nm-applet.enable = true; programs.nm-applet.enable = true;
} }

View File

@@ -0,0 +1,22 @@
{
pkgs,
username,
...
}:
{
virtualisation = {
libvirtd = {
enable = true;
qemu = {
# package = pkgs.qemu_full;
package = pkgs.qemu;
runAsRoot = true;
swtpm.enable = true;
};
};
};
users.users.${username} = {
extraGroups = [ "libvirtd" ];
};
}

View File

@@ -0,0 +1,96 @@
{
...
}:
{
environment.sessionVariables = {
KUBECONFIG = "$HOME/.kube/config";
};
programs.starship = {
enable = true;
settings = {
add_newline = true;
command_timeout = 1300;
scan_timeout = 50;
format = "[](fg:surface1)$hostname$username$directory$git_branch$git_status[](fg:base bg:sky)$fill$kubernetes$time[ ](fg:surface1)$line_break[ ](fg:surface1)";
right_format = "[](fg:surface1)";
palette = "catppuccin_frappe";
hostname = {
ssh_only = false;
format = "[](bg:base fg:mauve)[ $hostname ](bg:mauve fg:base)[](bg:mauve fg:blue)";
disabled = false;
};
username = {
style_user = "bg:blue fg:base";
style_root = "bg:red fg:base bold";
format = "[ $user ]($style)[](bg:blue fg:sapphire)";
show_always = true;
disabled = false;
};
directory = {
format = "[ $path ](bg:sapphire fg:base)[](bg:sapphire fg:sky)";
truncation_length = 3;
truncation_symbol = "/";
};
git_branch = {
symbol = " ";
format = "[ $symbol$branch(:$remote_branch) ](fg:base bg:sky)";
disabled = false;
};
git_status = {
format = "([$all_status$ahead_behind ](fg:base bg:sky))";
conflicted = "😵";
ahead = "";
behind = "";
diverged = "😵";
up_to_date = "";
untracked = "";
stashed = "📦";
modified = "";
#staged = "[($count)](fg:base bg:sapphire)"
staged = "";
renamed = "";
deleted = "";
disabled = false;
};
kubernetes = {
disabled = false;
format = "[](fg:blue bg:base)[ ($namespace)/($cluster) ](fg:base bg:blue)[](bg:blue fg:mauve)";
};
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";
};
};
};
}