Compare commits
75 commits
6c4377f7e1
...
4ebb3aaed1
Author | SHA1 | Date | |
---|---|---|---|
4ebb3aaed1 | |||
5766455c95 | |||
de7a2753df | |||
1a0c925449 | |||
02b0b569ea | |||
adfe3ce6cd | |||
d08eb3a107 | |||
2aa8ea0180 | |||
a4a651133b | |||
350f85904b | |||
ab869efa90 | |||
bbae058bcb | |||
0a8a480845 | |||
2aa2199cad | |||
d464f0f053 | |||
64f6f336ea | |||
a1aa8f0b25 | |||
9ed4324c52 | |||
3903008b44 | |||
86d8732081 | |||
851a9cecac | |||
1519fb0acb | |||
84c3e1ef32 | |||
eba430685f | |||
1c605c6665 | |||
19e9b330dd | |||
3049f81aab | |||
9cd4e0d972 | |||
4ac5527aca | |||
fb97c4e0d5 | |||
9c105efe71 | |||
da1008f661 | |||
a7be324484 | |||
e8fca43d0c | |||
f0aabeee50 | |||
be0e89431a | |||
f4780259a7 | |||
b994549a1c | |||
4e8b840830 | |||
e493646556 | |||
c2c0471097 | |||
65be421f53 | |||
bf45f5ebe3 | |||
468bd046ee | |||
73f00bcc14 | |||
31c5516a9f | |||
064530792a | |||
6444f1842e | |||
9f21445d76 | |||
80e84d19ac | |||
624ed44bba | |||
34cbb44cc1 | |||
361ecd917e | |||
3ef6e6e381 | |||
ed8665fa49 | |||
4fa1f87caa | |||
242fc839cd | |||
6c93b657c5 | |||
0367ebecae | |||
00cbba8b0a | |||
de6d981cf0 | |||
63a9058e30 | |||
65ce70cda9 | |||
8e722cfe5a | |||
819cd005c7 | |||
5a52a2734d | |||
21e26daea3 | |||
1829515dd3 | |||
db5ca96ada | |||
98040c5e71 | |||
6636261dbc | |||
1d210c4cad | |||
9d3bbbe01a | |||
03b8fb2d5d | |||
3bc86778ff |
39 changed files with 430 additions and 2188 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
result
|
result
|
||||||
*.swp
|
*.swp
|
||||||
*.qcow2
|
*.qcow2
|
||||||
|
.idea/
|
55
README.md
55
README.md
|
@ -10,31 +10,6 @@ nixos-rebuild switch --flake flake_path_directory#hostname
|
||||||
nix flake update --extra-experimental-features "nix-command flakes"
|
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
|
## Show changements between revisions
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,36 +47,6 @@ error: cached failure of attribute 'nixosConfigurations.perso-desktop.config.sys
|
||||||
sudo rm -fr /root/.cache/nix/
|
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
|
## To limit resources use during build
|
||||||
|
|
||||||
|
|
36
flake.lock
generated
36
flake.lock
generated
|
@ -12,11 +12,11 @@
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716561646,
|
"lastModified": 1723293904,
|
||||||
"narHash": "sha256-UIGtLO89RxKt7RF2iEgPikSdU53r6v/6WYB0RW3k89I=",
|
"narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=",
|
||||||
"owner": "ryantm",
|
"owner": "ryantm",
|
||||||
"repo": "agenix",
|
"repo": "agenix",
|
||||||
"rev": "c2fc0762bbe8feb06a2e59a364fa81b3a57671c9",
|
"rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -251,11 +251,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716736760,
|
"lastModified": 1726036828,
|
||||||
"narHash": "sha256-h3RmnNknKYtVA+EvUSra6QAwfZjC2q1G8YA7W0gat8Y=",
|
"narHash": "sha256-ZQHbpyti0jcAKnwQY1lwmooecLmSG6wX1JakQ/eZNeM=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "5d151429e1e79107acf6d06dcc5ace4e642ec239",
|
"rev": "8a1671642826633586d12ac3158e463c7a50a112",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -345,11 +345,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716509168,
|
"lastModified": 1725983898,
|
||||||
"narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=",
|
"narHash": "sha256-4b3A9zPpxAxLnkF9MawJNHDtOOl6ruL0r6Og1TEDGCE=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "bfb7a882678e518398ce9a31a881538679f6f092",
|
"rev": "1355a0cbfeac61d785b7183c0caaec1f97361b43",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -375,6 +375,21 @@
|
||||||
"type": "github"
|
"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": {
|
"ob-racket": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -478,7 +493,8 @@
|
||||||
"nix-doom-emacs": "nix-doom-emacs",
|
"nix-doom-emacs": "nix-doom-emacs",
|
||||||
"nix-flatpak": "nix-flatpak",
|
"nix-flatpak": "nix-flatpak",
|
||||||
"nix-straight": "nix-straight",
|
"nix-straight": "nix-straight",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs",
|
||||||
|
"nur": "nur"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rotate-text": {
|
"rotate-text": {
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
nur.url = github:nix-community/NUR;
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
|
@ -35,6 +36,7 @@
|
||||||
|
|
||||||
outputs = inputs@{
|
outputs = inputs@{
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
|
nur,
|
||||||
home-manager,
|
home-manager,
|
||||||
agenix,
|
agenix,
|
||||||
nix-flatpak,
|
nix-flatpak,
|
||||||
|
@ -57,6 +59,7 @@
|
||||||
./hosts/${s.name}/configuration.nix
|
./hosts/${s.name}/configuration.nix
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
|
{ nixpkgs.overlays = [ nur.overlay ]; }
|
||||||
{
|
{
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
|
|
|
@ -13,10 +13,6 @@
|
||||||
kitty.enable = true;
|
kitty.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
editors = {
|
|
||||||
vscode.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
shell = {
|
shell = {
|
||||||
zsh.enable = true;
|
zsh.enable = true;
|
||||||
atuin.enable = true;
|
atuin.enable = true;
|
||||||
|
|
|
@ -20,6 +20,10 @@
|
||||||
networking.hostName = "nixos-desktop-perso"; # Define your hostname.
|
networking.hostName = "nixos-desktop-perso"; # Define your hostname.
|
||||||
|
|
||||||
modules.system = {
|
modules.system = {
|
||||||
|
apps = {
|
||||||
|
steam.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
desktop = {
|
desktop = {
|
||||||
plasma.enable = true;
|
plasma.enable = true;
|
||||||
};
|
};
|
||||||
|
@ -34,5 +38,9 @@
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
waydroid.enable = true;
|
waydroid.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
server = {
|
||||||
|
distrobox.enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,15 +8,12 @@
|
||||||
modules.home = {
|
modules.home = {
|
||||||
apps = {
|
apps = {
|
||||||
chromium.enable = true;
|
chromium.enable = true;
|
||||||
|
firefox.enable = true;
|
||||||
flatpak.enable = true;
|
flatpak.enable = true;
|
||||||
jetbrainsToolbox.enable = true;
|
jetbrainsToolbox.enable = true;
|
||||||
kitty.enable = true;
|
kitty.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
editors = {
|
|
||||||
vscode.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
shell = {
|
shell = {
|
||||||
zsh.enable = true;
|
zsh.enable = true;
|
||||||
atuin.enable = true;
|
atuin.enable = true;
|
||||||
|
|
|
@ -13,10 +13,6 @@
|
||||||
kitty.enable = true;
|
kitty.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
editors = {
|
|
||||||
vscode.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
shell = {
|
shell = {
|
||||||
zsh.enable = true;
|
zsh.enable = true;
|
||||||
atuin.enable = true;
|
atuin.enable = true;
|
||||||
|
|
|
@ -19,18 +19,18 @@
|
||||||
|
|
||||||
networking.hostName = "nixos-laptop-pro"; # Define your hostname.
|
networking.hostName = "nixos-laptop-pro"; # Define your hostname.
|
||||||
|
|
||||||
hardware.nvidia.prime = {
|
# hardware.nvidia.prime = {
|
||||||
offload = {
|
# offload = {
|
||||||
enable = true;
|
# enable = true;
|
||||||
enableOffloadCmd = true;
|
# enableOffloadCmd = true;
|
||||||
};
|
# };
|
||||||
|
#
|
||||||
# Make sure to use the correct Bus ID values for your system!
|
# # Make sure to use the correct Bus ID values for your system!
|
||||||
# information bus: pci@0000:00:02.0
|
# # information bus: pci@0000:00:02.0
|
||||||
intelBusId = "PCI:0:2:0";
|
# intelBusId = "PCI:0:2:0";
|
||||||
# information bus: pci@0000:01:00.0
|
# # information bus: pci@0000:01:00.0
|
||||||
nvidiaBusId = "PCI:1:0:0";
|
# nvidiaBusId = "PCI:1:0:0";
|
||||||
};
|
# };
|
||||||
|
|
||||||
modules.system = {
|
modules.system = {
|
||||||
desktop = {
|
desktop = {
|
||||||
|
@ -47,5 +47,9 @@
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
waydroid.enable = true;
|
waydroid.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
server = {
|
||||||
|
distrobox.enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,15 +8,12 @@
|
||||||
modules.home = {
|
modules.home = {
|
||||||
apps = {
|
apps = {
|
||||||
chromium.enable = true;
|
chromium.enable = true;
|
||||||
|
firefox.enable = true;
|
||||||
flatpak.enable = true;
|
flatpak.enable = true;
|
||||||
jetbrainsToolbox.enable = true;
|
jetbrainsToolbox.enable = true;
|
||||||
kitty.enable = true;
|
kitty.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
editors = {
|
|
||||||
vscode.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
shell = {
|
shell = {
|
||||||
zsh.enable = true;
|
zsh.enable = true;
|
||||||
atuin.enable = true;
|
atuin.enable = true;
|
||||||
|
|
5
modules/common.nix
Normal file
5
modules/common.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
}
|
|
@ -1,10 +1,11 @@
|
||||||
{ config, pkgs, ... }:
|
{ ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./chromium
|
./chromium
|
||||||
|
./firefox
|
||||||
./flatpak
|
./flatpak
|
||||||
./jetbrainsToolbox
|
./jetbrainsToolbox
|
||||||
./kitty
|
./kitty
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
44
modules/home/apps/firefox/default.nix
Normal file
44
modules/home/apps/firefox/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -12,7 +12,6 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
services.flatpak = {
|
services.flatpak = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
@ -21,22 +20,15 @@ in
|
||||||
packages = [
|
packages = [
|
||||||
# Gaming
|
# Gaming
|
||||||
{ appId = "com.discordapp.Discord"; origin = "flathub"; }
|
{ appId = "com.discordapp.Discord"; origin = "flathub"; }
|
||||||
{ appId = "com.valvesoftware.Steam"; origin = "flathub"; }
|
|
||||||
{ appId = "net.lutris.Lutris"; origin = "flathub"; }
|
{ appId = "net.lutris.Lutris"; origin = "flathub"; }
|
||||||
|
|
||||||
# Pro
|
# 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 = "ch.protonmail.protonmail-bridge"; origin = "flathub"; }
|
||||||
{ appId = "org.kde.neochat"; origin = "flathub"; }
|
{ appId = "org.kde.neochat"; origin = "flathub"; }
|
||||||
|
|
||||||
# Loisir
|
# Loisir
|
||||||
{ appId = "com.spotify.Client"; origin = "flathub"; }
|
{ appId = "com.spotify.Client"; origin = "flathub"; }
|
||||||
{ appId = "io.gitlab.news_flash.NewsFlash"; origin = "flathub"; }
|
|
||||||
{ appId = "org.videolan.VLC"; origin = "flathub"; }
|
{ appId = "org.videolan.VLC"; origin = "flathub"; }
|
||||||
{ appId = "com.obsproject.Studio"; origin = "flathub"; }
|
|
||||||
{ appId = "io.github.achetagames.epic_asset_manager"; origin = "flathub"; }
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,6 +11,6 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = with pkgs; [jetbrains-toolbox];
|
home.packages = with pkgs; [jetbrains-toolbox graalvm-ce];
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
../common.nix
|
||||||
./apps
|
./apps
|
||||||
./editors
|
./editors
|
||||||
./desktop
|
./desktop
|
||||||
|
@ -16,6 +17,5 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ in
|
||||||
|
|
||||||
userTasks = {};
|
userTasks = {};
|
||||||
|
|
||||||
|
# Waiting https://github.com/nix-community/home-manager/pull/5640 to support multi-profiles support
|
||||||
extensions = with pkgs; with vscode-extensions; [
|
extensions = with pkgs; with vscode-extensions; [
|
||||||
# Nix
|
# Nix
|
||||||
bbenoist.nix
|
bbenoist.nix
|
||||||
|
|
|
@ -13,10 +13,20 @@ in
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
lfs.enable = true;
|
||||||
|
|
||||||
userName = "Florian RICHER";
|
userName = "Florian RICHER";
|
||||||
userEmail = "florian.richer@protonmail.com";
|
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:";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
7
modules/system/apps/default.nix
Normal file
7
modules/system/apps/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./steam
|
||||||
|
];
|
||||||
|
}
|
22
modules/system/apps/steam/default.nix
Normal file
22
modules/system/apps/steam/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,10 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
../common.nix
|
||||||
|
];
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
time.timeZone = "Europe/Paris";
|
time.timeZone = "Europe/Paris";
|
||||||
|
|
||||||
|
@ -21,13 +25,39 @@
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
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:
|
# List packages installed in system profile. To search, run:
|
||||||
# $ nix search wget
|
# $ nix search wget
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
vim
|
vim
|
||||||
nixd
|
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’.
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||||
users.users.florian = {
|
users.users.florian = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
|
@ -37,6 +67,10 @@
|
||||||
|
|
||||||
services.flatpak.enable = true; # Important can't be enabled from home-manager
|
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.
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
|
|
||||||
# Configure network proxy if necessary
|
# Configure network proxy if necessary
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./apps
|
||||||
./desktop
|
./desktop
|
||||||
./hardware
|
./hardware
|
||||||
./server
|
./server
|
||||||
|
|
|
@ -26,17 +26,6 @@ in
|
||||||
environment.systemPackages = with pkgs; with kdePackages; [
|
environment.systemPackages = with pkgs; with kdePackages; [
|
||||||
krfb # Use by kdeconnect for virtualmonitorplugin "krfb-virtualmonitor"
|
krfb # Use by kdeconnect for virtualmonitorplugin "krfb-virtualmonitor"
|
||||||
discover
|
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)
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,41 +11,51 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
# Enable OpenGL
|
|
||||||
hardware.opengl = {
|
|
||||||
enable = true;
|
|
||||||
driSupport = true;
|
|
||||||
driSupport32Bit = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Load nvidia driver for Xorg and Wayland
|
# Load nvidia driver for Xorg and Wayland
|
||||||
services.xserver.videoDrivers = ["nvidia"];
|
services.xserver.videoDrivers = ["nvidia"];
|
||||||
|
|
||||||
hardware.nvidia = {
|
hardware = {
|
||||||
# Modesetting is required.
|
graphics = {
|
||||||
modesetting.enable = true;
|
enable = true;
|
||||||
|
enable32Bit = true;
|
||||||
|
};
|
||||||
|
|
||||||
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
nvidia-container-toolkit.enable = true;
|
||||||
powerManagement.enable = false;
|
|
||||||
# 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;
|
|
||||||
|
|
||||||
# Use the NVidia open source kernel module (not to be confused with the
|
nvidia = {
|
||||||
# independent third-party "nouveau" open source driver).
|
# Modesetting is required.
|
||||||
# Support is limited to the Turing and later architectures. Full list of
|
modesetting.enable = true;
|
||||||
# supported GPUs is at:
|
|
||||||
# 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;
|
|
||||||
|
|
||||||
# Enable the Nvidia settings menu,
|
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
||||||
# accessible via `nvidia-settings`.
|
# Enable this if you have graphical corruption issues or application crashes after waking
|
||||||
nvidiaSettings = true;
|
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
|
||||||
|
# of just the bare essentials.
|
||||||
|
powerManagement.enable = true;
|
||||||
|
|
||||||
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
# Fine-grained power management. Turns off GPU when not in use.
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
||||||
|
powerManagement.finegrained = false;
|
||||||
|
|
||||||
|
# Use the NVidia open source kernel module (not to be confused with the
|
||||||
|
# independent third-party "nouveau" open source driver).
|
||||||
|
# Support is limited to the Turing and later architectures. Full list of
|
||||||
|
# supported GPUs is at:
|
||||||
|
# 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 = 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.latest;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# boot.extraModprobeConfig = ''
|
||||||
|
# options nvidia NVreg_EnableGpuFirmware=0
|
||||||
|
# '';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ in
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
# Enable sound with pipewire.
|
# Enable sound with pipewire.
|
||||||
sound.enable = true;
|
|
||||||
hardware.pulseaudio.enable = false;
|
hardware.pulseaudio.enable = false;
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
|
@ -28,4 +27,4 @@ in
|
||||||
#media-session.enable = true;
|
#media-session.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./distrobox
|
||||||
./docker
|
./docker
|
||||||
|
./ollama
|
||||||
./openssh
|
./openssh
|
||||||
];
|
];
|
||||||
}
|
}
|
17
modules/system/server/distrobox/default.nix
Normal file
17
modules/system/server/distrobox/default.nix
Normal 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 ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -13,7 +13,8 @@ in
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
virtualisation.docker = {
|
virtualisation.docker = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableNvidia = config.modules.system.hardware.nvidia.enable;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users.users.florian.extraGroups = [ "docker" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
21
modules/system/server/ollama/default.nix
Normal file
21
modules/system/server/ollama/default.nix
Normal 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
0
overlays/.gitkeep
Normal file
File diff suppressed because it is too large
Load diff
|
@ -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
|
|
||||||
];
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
30
tips/debug_insecure_package.md
Normal file
30
tips/debug_insecure_package.md
Normal 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
|
24
tips/distrobox/kde/.kde_bashrc
Normal file
24
tips/distrobox/kde/.kde_bashrc
Normal 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
20
tips/distrobox/kde/configure.sh
Executable 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"
|
6
tips/distrobox/kde/distrobox.ini
Normal file
6
tips/distrobox/kde/distrobox.ini
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[kdedev]
|
||||||
|
image=quay.io/fedora/fedora:latest
|
||||||
|
home="${HOME}/.distrobox_home/kdedev"
|
||||||
|
nvidia=true
|
||||||
|
root=false
|
||||||
|
pull=true
|
19
tips/distrobox/kde/use_distrobox.md
Normal file
19
tips/distrobox/kde/use_distrobox.md
Normal 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
36
tips/how_to_test_pr.md
Normal 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
24
tips/test_on_vm.md
Normal 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
|
||||||
|
```
|
Loading…
Add table
Reference in a new issue