Compare commits

..

75 commits

Author SHA1 Message Date
4ebb3aaed1
modules(editors) : Add emacs 2024-09-15 14:12:12 +02:00
5766455c95
vscode: Add comment for multi-profiles
All checks were successful
check / check (push) Successful in 32s
2024-09-15 14:10:34 +02:00
de7a2753df
flatpak: Remove not use applications
All checks were successful
check / check (push) Successful in 33s
2024-09-15 13:59:16 +02:00
1a0c925449
modules: Revert vscode from flatpak to modules
If needed to be installed with flatpak, it can be installed from Discover
2024-09-15 13:54:43 +02:00
02b0b569ea
Update OS
All checks were successful
check / check (push) Successful in 36s
2024-09-11 16:14:26 +02:00
adfe3ce6cd
tips(kdedev): Migrate to fedora latest and fix configure.sh
All checks were successful
check / check (push) Successful in 34s
2024-09-08 21:05:15 +02:00
d08eb3a107
tips(kdedev): Add .kde_bashrc
All checks were successful
check / check (push) Successful in 35s
2024-09-07 20:55:40 +02:00
2aa8ea0180
Update tips
All checks were successful
check / check (push) Successful in 36s
2024-09-06 19:29:30 +02:00
a4a651133b
steam: Move to system instead of Flatpak
All checks were successful
check / check (push) Successful in 36s
- Support of gamescope for HDR
- Best integration with udev devices
- Add proton-ge
2024-09-05 22:47:19 +02:00
350f85904b
pro-laptop: Add firefox
All checks were successful
check / check (push) Successful in 37s
2024-09-05 15:08:25 +02:00
ab869efa90
Update OS 2024-09-05 15:08:11 +02:00
bbae058bcb
Update OS
All checks were successful
check / check (push) Successful in 34s
2024-09-01 19:32:32 +02:00
0a8a480845
Begin work on distrobox configuration for KDE Development
All checks were successful
check / check (push) Successful in 35s
2024-08-30 18:48:21 +02:00
2aa2199cad
Update OS
All checks were successful
check / check (push) Successful in 30s
2024-08-29 09:10:10 +02:00
d464f0f053
Update OS
All checks were successful
check / check (push) Successful in 36s
2024-08-26 19:46:01 +02:00
64f6f336ea
Update OS
All checks were successful
check / check (push) Successful in 32s
2024-08-23 21:07:13 +02:00
a1aa8f0b25
Refactor nix experimental-features to use on home and system side
All checks were successful
check / check (push) Successful in 33s
2024-08-15 22:00:29 +02:00
9ed4324c52
Add graalvm for jetbrains-toolbox IDEs for more performance
All checks were successful
check / check (push) Successful in 29s
2024-08-15 16:31:30 +02:00
3903008b44
Update OS
All checks were successful
check / check (push) Successful in 36s
2024-08-15 16:26:13 +02:00
86d8732081
Remove ollama for perso/pro 2024-08-15 16:25:29 +02:00
851a9cecac
fix(deprecated) : You have set virtualisation.docker.enableNvidia. This option is deprecated, please set hardware.nvidia-container-toolkit.enable instead 2024-08-15 16:24:09 +02:00
1519fb0acb
Update OS
All checks were successful
check / check (push) Successful in 35s
2024-08-12 13:36:14 +02:00
84c3e1ef32
Update OS
All checks were successful
check / check (push) Successful in 35s
2024-08-09 08:33:16 +02:00
eba430685f
Update OS
All checks were successful
check / check (push) Successful in 41s
2024-08-01 09:44:48 +02:00
1c605c6665
nvidia: Enable open version
All checks were successful
check / check (push) Successful in 32s
2024-07-23 17:35:47 +02:00
19e9b330dd
Update OS
All checks were successful
check / check (push) Successful in 30s
2024-07-23 11:15:09 +02:00
3049f81aab
home(git): Enable signing gpg
All checks were successful
check / check (push) Successful in 28s
2024-07-18 21:46:04 +02:00
9cd4e0d972
Update OS
All checks were successful
check / check (push) Successful in 43s
2024-07-18 19:02:05 +02:00
4ac5527aca
Add gpg with yubikey
All checks were successful
check / check (push) Successful in 30s
2024-07-14 20:40:20 +02:00
fb97c4e0d5 Add example to extra modprobe
All checks were successful
check / check (push) Successful in 32s
2024-07-11 21:32:19 +02:00
9c105efe71 pro-laptop: Disable iGPU (Low performance)
All checks were successful
check / check (push) Successful in 32s
2024-07-11 09:43:45 +02:00
da1008f661 Update OS
All checks were successful
check / check (push) Successful in 33s
2024-07-11 08:58:26 +02:00
a7be324484 Update OS
All checks were successful
check / check (push) Successful in 33s
2024-07-05 10:20:46 +02:00
e8fca43d0c tips(how_to_test_pr): Add content in nix block code
All checks were successful
check / check (push) Successful in 30s
2024-07-01 19:29:30 +02:00
f0aabeee50 nvidia: powerManagement.enable => true
All checks were successful
check / check (push) Successful in 31s
2024-07-01 14:08:09 +02:00
be0e89431a Update OS
All checks were successful
check / check (push) Successful in 35s
2024-07-01 13:33:47 +02:00
f4780259a7 Add tools to debug
All checks were successful
check / check (push) Successful in 32s
2024-06-29 15:03:10 +02:00
b994549a1c Add nixseparatedebuginfod
All checks were successful
check / check (push) Successful in 28s
2024-06-29 14:57:19 +02:00
4e8b840830 Add tips
All checks were successful
check / check (push) Successful in 28s
2024-06-29 11:07:30 +02:00
e493646556 Update OS
All checks were successful
check / check (push) Successful in 29s
2024-06-29 11:05:38 +02:00
c2c0471097 Update OS
All checks were successful
check / check (push) Successful in 30s
2024-06-29 10:39:32 +02:00
65be421f53 pro-laptop: Add iGPU (Test triple-buffering on plasma 6.1)
All checks were successful
check / check (push) Successful in 30s
2024-06-27 13:40:20 +02:00
bf45f5ebe3 Update home-manager + add Firefox
All checks were successful
check / check (push) Successful in 35s
2024-06-25 20:07:09 +02:00
468bd046ee Add git lfs
All checks were successful
check / check (push) Successful in 33s
2024-06-24 10:34:22 +02:00
73f00bcc14 Update OS
All checks were successful
check / check (push) Successful in 31s
2024-06-23 12:22:47 +02:00
31c5516a9f Update OS: Fix hardware.opengl -> hardware.graphics migration
All checks were successful
check / check (push) Successful in 28s
2024-06-21 21:59:22 +02:00
064530792a Update OS
All checks were successful
check / check (push) Successful in 35s
2024-06-21 21:36:18 +02:00
6444f1842e Update OS
All checks were successful
check / check (push) Successful in 33s
2024-06-20 15:57:56 +02:00
9f21445d76 Update OS
All checks were successful
check / check (push) Successful in 28s
2024-06-20 09:03:26 +02:00
80e84d19ac pro-laptop: Add distrobox
All checks were successful
check / check (push) Successful in 33s
2024-06-20 09:02:32 +02:00
624ed44bba Update OS
All checks were successful
check / check (push) Successful in 29s
2024-06-18 23:32:47 +02:00
34cbb44cc1 Add distrobox
All checks were successful
check / check (push) Successful in 33s
2024-06-18 19:44:19 +02:00
361ecd917e Update OS
All checks were successful
check / check (push) Successful in 34s
2024-06-14 22:27:06 +02:00
3ef6e6e381 git: Add required configuration for kdesrc-build
All checks were successful
check / check (push) Successful in 35s
2024-06-13 19:42:52 +02:00
ed8665fa49 Update OS
All checks were successful
check / check (push) Successful in 35s
2024-06-13 09:10:15 +02:00
4fa1f87caa Update OS
All checks were successful
check / check (push) Successful in 34s
2024-06-11 18:34:20 +02:00
242fc839cd Update OS
All checks were successful
check / check (push) Successful in 34s
2024-06-09 13:08:43 +02:00
6c93b657c5 Add usbutils and pciutils
All checks were successful
check / check (push) Successful in 27s
2024-06-07 19:53:53 +02:00
0367ebecae Fix fwupd
All checks were successful
check / check (push) Successful in 28s
2024-06-07 19:40:54 +02:00
00cbba8b0a Add fwupd and aha
All checks were successful
check / check (push) Successful in 33s
2024-06-07 19:37:01 +02:00
de6d981cf0 Update OS 2024-06-06 19:35:57 +02:00
63a9058e30 perso-laptop: Add ollama
All checks were successful
check / check (push) Successful in 33s
2024-06-06 19:32:39 +02:00
65ce70cda9 pro-laptop: Add ollama
All checks were successful
check / check (push) Successful in 32s
2024-06-05 08:58:04 +02:00
8e722cfe5a modules: Move vscode to flatpak
All checks were successful
check / check (push) Successful in 28s
2024-06-04 21:59:55 +02:00
819cd005c7 perso-desktop: Enable ollama
All checks were successful
check / check (push) Successful in 34s
2024-06-04 21:14:48 +02:00
5a52a2734d perso-desktop: Remove ollama
All checks were successful
check / check (push) Successful in 29s
2024-06-03 20:32:09 +02:00
21e26daea3 pro-laptop: Remove iGPU (Very slow)
All checks were successful
check / check (push) Successful in 29s
2024-06-03 12:45:16 +02:00
1829515dd3 pto-laptop: Remove ollama + Set nvidia to prime sync
All checks were successful
check / check (push) Successful in 29s
2024-06-03 09:39:04 +02:00
db5ca96ada Update OS
All checks were successful
check / check (push) Successful in 35s
2024-06-03 09:09:10 +02:00
98040c5e71 Update OS
All checks were successful
check / check (push) Successful in 29s
2024-05-31 13:46:47 +02:00
6636261dbc kwin: Remove syncobj patch
All checks were successful
check / check (push) Successful in 32s
Useless because lot of application run with XWayland and is already patched for NVIDIA 555
2024-05-31 12:15:48 +02:00
1d210c4cad perso-desktop: Enable ollama
All checks were successful
check / check (push) Successful in 33s
2024-05-31 11:02:50 +02:00
9d3bbbe01a Update OS
All checks were successful
check / check (push) Successful in 30s
2024-05-29 13:41:11 +02:00
03b8fb2d5d modules.system.server.ollama: use var nvidiaEnabled
All checks were successful
check / check (push) Successful in 29s
2024-05-29 10:46:26 +02:00
3bc86778ff Install ollama (support for cuda)
All checks were successful
check / check (push) Successful in 33s
2024-05-29 10:17:45 +02:00
39 changed files with 430 additions and 2188 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
result
*.swp
*.qcow2
.idea/

View file

@ -10,31 +10,6 @@ nixos-rebuild switch --flake flake_path_directory#hostname
nix flake update --extra-experimental-features "nix-command flakes"
```
## Configure VM
Configure VM
```nix
users.users.<user>.initialPassword = "<password>";
virtualisation.vmVariant = {
# following configuration is added only when building VM with build-vm
virtualisation = {
memorySize = <RAM in MiB>; # Use 8192MiB memory.
cores = <CPU Core number>;
# And more here https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/virtualisation/qemu-vm.nix
};
};
```
Build
```bash
nixos-rebuild build-vm --flake .#nixos-test
```
Run
```bash
./result/bin/run-nixos-vm-vm
```
## Show changements between revisions
@ -72,36 +47,6 @@ error: cached failure of attribute 'nixosConfigurations.perso-desktop.config.sys
sudo rm -fr /root/.cache/nix/
```
## If package is marked as insecure
Example:
> error: Package 'nix-2.16.2' in /nix/store/nra828scc8qs92b9pxra5csqzffb6hpl-source/pkgs/tools/package-management/nix/default.nix:229 is marked as insecure, refusing to evaluate.
>
> Known issues:
> - CVE-2024-27297
```bash
nix path-info -r /run/current-system | grep nix-2.16.2
```
Result:
> [...]
>
> /nix/store/g4ss2h40n3j37bq20x1qw5s7nl82lch5-nix-2.16.2
>
> [...]
```bash
nix-store -q --referrers /nix/store/g4ss2h40n3j37bq20x1qw5s7nl82lch5-nix-2.16.2
```
Result:
> /nix/store/g4ss2h40n3j37bq20x1qw5s7nl82lch5-nix-2.16.2
>
> /nix/store/72pfc05339izcwqhlbs8441brrdasas7-nix-2.16.2-dev
>
> /nix/store/ln2z5d5izn8icm3wx94ci13ad19lzjhr-nixd-1.2.3
nixd is not up to date and require nix 2.16.2
## To limit resources use during build

36
flake.lock generated
View file

@ -12,11 +12,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1716561646,
"narHash": "sha256-UIGtLO89RxKt7RF2iEgPikSdU53r6v/6WYB0RW3k89I=",
"lastModified": 1723293904,
"narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=",
"owner": "ryantm",
"repo": "agenix",
"rev": "c2fc0762bbe8feb06a2e59a364fa81b3a57671c9",
"rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41",
"type": "github"
},
"original": {
@ -251,11 +251,11 @@
]
},
"locked": {
"lastModified": 1716736760,
"narHash": "sha256-h3RmnNknKYtVA+EvUSra6QAwfZjC2q1G8YA7W0gat8Y=",
"lastModified": 1726036828,
"narHash": "sha256-ZQHbpyti0jcAKnwQY1lwmooecLmSG6wX1JakQ/eZNeM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "5d151429e1e79107acf6d06dcc5ace4e642ec239",
"rev": "8a1671642826633586d12ac3158e463c7a50a112",
"type": "github"
},
"original": {
@ -345,11 +345,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1716509168,
"narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=",
"lastModified": 1725983898,
"narHash": "sha256-4b3A9zPpxAxLnkF9MawJNHDtOOl6ruL0r6Og1TEDGCE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "bfb7a882678e518398ce9a31a881538679f6f092",
"rev": "1355a0cbfeac61d785b7183c0caaec1f97361b43",
"type": "github"
},
"original": {
@ -375,6 +375,21 @@
"type": "github"
}
},
"nur": {
"locked": {
"lastModified": 1726059953,
"narHash": "sha256-uuqSnIgC2g3W6wk6Of1HvOFgFvo5Q+h0469VwMzDaBI=",
"owner": "nix-community",
"repo": "NUR",
"rev": "72296d37a29541a017e545c8f4e2c5c37dbaba59",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"ob-racket": {
"flake": false,
"locked": {
@ -478,7 +493,8 @@
"nix-doom-emacs": "nix-doom-emacs",
"nix-flatpak": "nix-flatpak",
"nix-straight": "nix-straight",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"nur": "nur"
}
},
"rotate-text": {

View file

@ -3,6 +3,7 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nur.url = github:nix-community/NUR;
home-manager = {
url = "github:nix-community/home-manager";
@ -35,6 +36,7 @@
outputs = inputs@{
nixpkgs,
nur,
home-manager,
agenix,
nix-flatpak,
@ -57,6 +59,7 @@
./hosts/${s.name}/configuration.nix
home-manager.nixosModules.home-manager
agenix.nixosModules.default
{ nixpkgs.overlays = [ nur.overlay ]; }
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;

View file

@ -13,10 +13,6 @@
kitty.enable = true;
};
editors = {
vscode.enable = true;
};
shell = {
zsh.enable = true;
atuin.enable = true;

View file

@ -20,6 +20,10 @@
networking.hostName = "nixos-desktop-perso"; # Define your hostname.
modules.system = {
apps = {
steam.enable = true;
};
desktop = {
plasma.enable = true;
};
@ -34,5 +38,9 @@
printing.enable = true;
waydroid.enable = true;
};
server = {
distrobox.enable = true;
};
};
}

View file

@ -8,15 +8,12 @@
modules.home = {
apps = {
chromium.enable = true;
firefox.enable = true;
flatpak.enable = true;
jetbrainsToolbox.enable = true;
kitty.enable = true;
};
editors = {
vscode.enable = true;
};
shell = {
zsh.enable = true;
atuin.enable = true;

View file

@ -13,10 +13,6 @@
kitty.enable = true;
};
editors = {
vscode.enable = true;
};
shell = {
zsh.enable = true;
atuin.enable = true;

View file

@ -19,18 +19,18 @@
networking.hostName = "nixos-laptop-pro"; # Define your hostname.
hardware.nvidia.prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
# Make sure to use the correct Bus ID values for your system!
# information bus: pci@0000:00:02.0
intelBusId = "PCI:0:2:0";
# information bus: pci@0000:01:00.0
nvidiaBusId = "PCI:1:0:0";
};
# hardware.nvidia.prime = {
# offload = {
# enable = true;
# enableOffloadCmd = true;
# };
#
# # Make sure to use the correct Bus ID values for your system!
# # information bus: pci@0000:00:02.0
# intelBusId = "PCI:0:2:0";
# # information bus: pci@0000:01:00.0
# nvidiaBusId = "PCI:1:0:0";
# };
modules.system = {
desktop = {
@ -47,5 +47,9 @@
printing.enable = true;
waydroid.enable = true;
};
server = {
distrobox.enable = true;
};
};
}

View file

@ -8,15 +8,12 @@
modules.home = {
apps = {
chromium.enable = true;
firefox.enable = true;
flatpak.enable = true;
jetbrainsToolbox.enable = true;
kitty.enable = true;
};
editors = {
vscode.enable = true;
};
shell = {
zsh.enable = true;
atuin.enable = true;

5
modules/common.nix Normal file
View file

@ -0,0 +1,5 @@
{ ... }:
{
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}

View file

@ -1,8 +1,9 @@
{ config, pkgs, ... }:
{ ... }:
{
imports = [
./chromium
./firefox
./flatpak
./jetbrainsToolbox
./kitty

View file

@ -0,0 +1,44 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.home.apps.firefox;
in
{
options.modules.home.apps.firefox = {
enable = mkEnableOption ''
Enable firefox with my custom configurations
'';
};
config = mkIf cfg.enable {
programs.firefox = {
enable = true;
nativeMessagingHosts = [
pkgs.kdePackages.plasma-browser-integration
];
profiles = {
perso = {
id = 0;
name = "Perso";
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
ublock-origin
bitwarden
floccus
plasma-integration
istilldontcareaboutcookies
darkreader
];
settings = {
# Enable multi-pip
"media.videocontrols.picture-in-picture.allow-multiple" = true;
};
};
};
};
};
}

View file

@ -12,7 +12,6 @@ in
};
config = mkIf cfg.enable {
services.flatpak = {
enable = true;
@ -21,22 +20,15 @@ in
packages = [
# Gaming
{ appId = "com.discordapp.Discord"; origin = "flathub"; }
{ appId = "com.valvesoftware.Steam"; origin = "flathub"; }
{ appId = "net.lutris.Lutris"; origin = "flathub"; }
# Pro
{ appId = "com.slack.Slack"; origin = "flathub"; }
{ appId = "com.skype.Client"; origin = "flathub"; }
{ appId = "org.mozilla.Thunderbird"; origin = "flathub"; }
{ appId = "ch.protonmail.protonmail-bridge"; origin = "flathub"; }
{ appId = "org.kde.neochat"; origin = "flathub"; }
# Loisir
{ appId = "com.spotify.Client"; origin = "flathub"; }
{ appId = "io.gitlab.news_flash.NewsFlash"; origin = "flathub"; }
{ appId = "org.videolan.VLC"; origin = "flathub"; }
{ appId = "com.obsproject.Studio"; origin = "flathub"; }
{ appId = "io.github.achetagames.epic_asset_manager"; origin = "flathub"; }
];
};
};

View file

@ -11,6 +11,6 @@ in
'';
};
config = mkIf cfg.enable {
home.packages = with pkgs; [jetbrains-toolbox];
home.packages = with pkgs; [jetbrains-toolbox graalvm-ce];
};
}

View file

@ -2,6 +2,7 @@
{
imports = [
../common.nix
./apps
./editors
./desktop
@ -16,6 +17,5 @@
};
programs.home-manager.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}

View file

@ -26,6 +26,7 @@ in
userTasks = {};
# Waiting https://github.com/nix-community/home-manager/pull/5640 to support multi-profiles support
extensions = with pkgs; with vscode-extensions; [
# Nix
bbenoist.nix

View file

@ -13,10 +13,20 @@ in
config = mkIf cfg.enable {
programs.git = {
enable = true;
lfs.enable = true;
userName = "Florian RICHER";
userEmail = "florian.richer@protonmail.com";
# signing.signByDefault = true;
signing = {
signByDefault = true;
key = "B19E3F4A2D806AB4793FDF2FC73D37CBED7BFC77";
};
extraConfig = {
url."https://invent.kde.org/".insteadOf = "kde:";
url."ssh://git@invent.kde.org/".pushInsteadOf = "kde:";
};
};
};
}

View file

@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./steam
];
}

View file

@ -0,0 +1,22 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.system.apps.steam;
in
{
options.modules.system.apps.steam = {
enable = mkEnableOption ''
Enable steam with my custom configurations
'';
};
config = mkIf cfg.enable {
programs.steam = {
enable = true;
extraPackages = with pkgs; [ gamescope ];
extraCompatPackages = with pkgs; [ proton-ge-bin ];
};
hardware.steam-hardware.enable = true;
};
}

View file

@ -1,6 +1,10 @@
{ pkgs, ... }:
{
imports = [
../common.nix
];
# Set your time zone.
time.timeZone = "Europe/Paris";
@ -21,13 +25,39 @@
nixpkgs.config.allowUnfree = true;
services.udev.packages = [ pkgs.yubikey-personalization ];
services.pcscd.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
vim
nixd
# Usefull tools to debug
gdb
lldb
gammaray # QT Inspector
yubikey-manager
# Usefull for automatic informations collect software like KDE
vulkan-tools # For vulkaninfo command
wayland-utils # For wayland-info command
glxinfo
clinfo
aha
usbutils
pciutils
];
services.fwupd.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.florian = {
isNormalUser = true;
@ -37,6 +67,10 @@
services.flatpak.enable = true; # Important can't be enabled from home-manager
# Downloads and provides debug symbols and source code for nix derivations to gdb and other debuginfod-capable debuggers as needed.
# Require https://github.com/symphorien/nixseparatedebuginfod?tab=readme-ov-file#gdb
services.nixseparatedebuginfod.enable = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary

View file

@ -2,6 +2,7 @@
{
imports = [
./apps
./desktop
./hardware
./server

View file

@ -26,17 +26,6 @@ in
environment.systemPackages = with pkgs; with kdePackages; [
krfb # Use by kdeconnect for virtualmonitorplugin "krfb-virtualmonitor"
discover
# Usefull for automatic informations collect software like KDE
vulkan-tools # For vulkaninfo command
wayland-utils # For wayland-info command
glxinfo
clinfo
];
# Uncomment when kwin is available in nixpkgs and NVIDIA 555
nixpkgs.overlays = [
(import ../../../../overlays/kwin)
];
};
}

View file

@ -11,22 +11,27 @@ in
'';
};
config = mkIf cfg.enable {
# Enable OpenGL
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
hardware = {
graphics = {
enable = true;
enable32Bit = true;
};
nvidia-container-toolkit.enable = true;
nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = false;
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
@ -38,14 +43,19 @@ in
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
open = true;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.beta;
package = config.boot.kernelPackages.nvidiaPackages.latest;
};
};
# boot.extraModprobeConfig = ''
# options nvidia NVreg_EnableGpuFirmware=0
# '';
};
}

View file

@ -12,7 +12,6 @@ in
};
config = mkIf cfg.enable {
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {

View file

@ -2,7 +2,9 @@
{
imports = [
./distrobox
./docker
./ollama
./openssh
];
}

View file

@ -0,0 +1,17 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.system.server.distrobox;
in
{
options.modules.system.server.distrobox = {
enable = mkEnableOption ''
Enable distrobox with my custom configurations
'';
};
config = mkIf cfg.enable {
modules.system.server.docker.enable = true;
environment.systemPackages = with pkgs; [ distrobox ];
};
}

View file

@ -13,7 +13,8 @@ in
config = mkIf cfg.enable {
virtualisation.docker = {
enable = true;
enableNvidia = config.modules.system.hardware.nvidia.enable;
};
users.users.florian.extraGroups = [ "docker" ];
};
}

View file

@ -0,0 +1,21 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.system.server.ollama;
nvidiaEnabled = config.modules.system.hardware.nvidia.enable;
in
{
options.modules.system.server.ollama = {
enable = mkEnableOption ''
Enable ollama with my custom configurations
'';
};
config = mkIf cfg.enable {
services.ollama = {
enable = true;
acceleration = if nvidiaEnabled then "cuda" else null;
};
};
}

0
overlays/.gitkeep Normal file
View file

File diff suppressed because it is too large Load diff

View file

@ -1,9 +0,0 @@
self: super: {
kdePackages = super.kdePackages.overrideScope (kde-self: kde-super: rec {
kwin = kde-super.kwin.overrideAttrs (oldAttrs: rec {
patches = oldAttrs.patches ++ [
./5511.patch # https://invent.kde.org/plasma/kwin/-/merge_requests/5511
];
});
});
}

View file

@ -0,0 +1,30 @@
## If package is marked as insecure
Example:
> error: Package 'nix-2.16.2' in /nix/store/nra828scc8qs92b9pxra5csqzffb6hpl-source/pkgs/tools/package-management/nix/default.nix:229 is marked as insecure, refusing to evaluate.
>
> Known issues:
> - CVE-2024-27297
```bash
nix path-info -r /run/current-system | grep nix-2.16.2
```
Result:
> [...]
>
> /nix/store/g4ss2h40n3j37bq20x1qw5s7nl82lch5-nix-2.16.2
>
> [...]
```bash
nix-store -q --referrers /nix/store/g4ss2h40n3j37bq20x1qw5s7nl82lch5-nix-2.16.2
```
Result:
> /nix/store/g4ss2h40n3j37bq20x1qw5s7nl82lch5-nix-2.16.2
>
> /nix/store/72pfc05339izcwqhlbs8441brrdasas7-nix-2.16.2-dev
>
> /nix/store/ln2z5d5izn8icm3wx94ci13ad19lzjhr-nixd-1.2.3
nixd is not up to date and require nix 2.16.2

View file

@ -0,0 +1,24 @@
# Required for kde-builder command
if [[ $PATH != *".local/bin"* ]]; then
export PATH="$HOME/.local/bin:$PATH"
fi
# Workaround for NixOS
# ENVs have nix store references and made conflict during build or run of KDE Apps, Shells, Frameworks
alias new_shell="env -u PATH -u QML2_IMPORT_PATH -u QT_PLUGIN_PATH -u NIXPKGS_QT6_QML_IMPORT_PATH -u XDG_CONFIG_DIRS bash -l"
alias build_plasma_mobile="kde-builder plasma-mobile plasma-settings plasma-desktop kactivitymanagerd"
function run_mobile() {
source "$HOME/kde/build/plasma-mobile/prefix.sh"
QT_QPA_PLATFORM=offscreen plasma-mobile-envmanager --apply-settings
# Environment variables
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
export QT_QUICK_CONTROLS_MOBILE=1
export PLASMA_PLATFORM=phone:handheld
export QT_QUICK_CONTROLS_STYLE=org.kde.breeze
QT_QPA_PLATFORM=wayland dbus-run-session kwin_wayland --xwayland "plasmashell -p org.kde.plasma.mobileshell" --width 360 --height 720
}

20
tips/distrobox/kde/configure.sh Executable file
View file

@ -0,0 +1,20 @@
#!/bin/bash
if ! grep -Fxq "source ~/.kde_bashrc" ~/.bashrc
then
cp .kde_bashrc ~/.kde_bashrc
echo "source ~/.kde_bashrc" > ~/.bashrc
source ~/.bashrc
fi
echo "Installing kde-builder"
curl 'https://invent.kde.org/sdk/kde-builder/-/raw/master/scripts/initial_setup.sh?ref_type=heads' > ~/initial_setup.sh
bash ~/initial_setup.sh && rm ~/initial_setup.sh
echo "Run initial setup from kde-builder"
kde-builder --initial-setup
echo "Install missing dependencies"
sudo dnf install qt6-*-devel librsvg2-devel
echo "Configuration DONE"

View file

@ -0,0 +1,6 @@
[kdedev]
image=quay.io/fedora/fedora:latest
home="${HOME}/.distrobox_home/kdedev"
nvidia=true
root=false
pull=true

View file

@ -0,0 +1,19 @@
# How to develop on KDE
## First configuration
1. `distrobox assemble`
> You can add --replace to recreate distrobox container
2. `distrobox enter kdedev`
3. `bash configure.sh`
4. `kde-builder run solid`
> You use NixOS ? It's necessary to run `new_shell` alias before.
> The alias unset all nixos env variables with nix store references to avoid conflicts with build or run of KDE Shells/Apps/Tools.
## Usefull config in ~/.config/kdesrc-buildrc
Autogenerate editor configuration
- generate-clion-project-config
- generate-vscode-project-config
- generate-qtcreator-project-config

36
tips/how_to_test_pr.md Normal file
View file

@ -0,0 +1,36 @@
# Example for ollama
```nix
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.system.server.ollama;
nvidiaEnabled = config.modules.system.hardware.nvidia.enable;
nixpkgsPr = builtins.fetchTarball {
url = "https://github.com/abysssol/nixpkgs/archive/ollama-driver-runpath.tar.gz";
sha256 = "1ixfvdpi2v4r9yrkvqnfk9whs8lyjhrkdph47bcznh8ak9aipr8p";
};
in
{
disabledModules = [ "services/misc/ollama.nix" ];
imports = [
(import "${nixpkgsPr}/nixos/modules/services/misc/ollama.nix")
];
options.modules.system.server.ollama = {
enable = mkEnableOption ''
Enable ollama with my custom configurations
'';
};
config = mkIf cfg.enable {
services.ollama = {
enable = true;
package = (import nixpkgsPr { inherit (pkgs) system; config.allowUnfree = true; }).ollama;
acceleration = if nvidiaEnabled then "cuda" else null;
};
};
}
```

24
tips/test_on_vm.md Normal file
View file

@ -0,0 +1,24 @@
## Configure VM
Configure VM
```nix
users.users.<user>.initialPassword = "<password>";
virtualisation.vmVariant = {
# following configuration is added only when building VM with build-vm
virtualisation = {
memorySize = <RAM in MiB>; # Use 8192MiB memory.
cores = <CPU Core number>;
# And more here https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/virtualisation/qemu-vm.nix
};
};
```
Build
```bash
nixos-rebuild build-vm --flake .#nixos-test
```
Run
```bash
./result/bin/run-nixos-vm-vm
```