Compare commits
1 commit
4ebb3aaed1
...
6c4377f7e1
Author | SHA1 | Date | |
---|---|---|---|
6c4377f7e1 |
39 changed files with 2188 additions and 430 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,4 +1,3 @@
|
||||||
result
|
result
|
||||||
*.swp
|
*.swp
|
||||||
*.qcow2
|
*.qcow2
|
||||||
.idea/
|
|
55
README.md
55
README.md
|
@ -10,6 +10,31 @@ 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
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,6 +72,36 @@ 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": 1723293904,
|
"lastModified": 1716561646,
|
||||||
"narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=",
|
"narHash": "sha256-UIGtLO89RxKt7RF2iEgPikSdU53r6v/6WYB0RW3k89I=",
|
||||||
"owner": "ryantm",
|
"owner": "ryantm",
|
||||||
"repo": "agenix",
|
"repo": "agenix",
|
||||||
"rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41",
|
"rev": "c2fc0762bbe8feb06a2e59a364fa81b3a57671c9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -251,11 +251,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1726036828,
|
"lastModified": 1716736760,
|
||||||
"narHash": "sha256-ZQHbpyti0jcAKnwQY1lwmooecLmSG6wX1JakQ/eZNeM=",
|
"narHash": "sha256-h3RmnNknKYtVA+EvUSra6QAwfZjC2q1G8YA7W0gat8Y=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "8a1671642826633586d12ac3158e463c7a50a112",
|
"rev": "5d151429e1e79107acf6d06dcc5ace4e642ec239",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -345,11 +345,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1725983898,
|
"lastModified": 1716509168,
|
||||||
"narHash": "sha256-4b3A9zPpxAxLnkF9MawJNHDtOOl6ruL0r6Og1TEDGCE=",
|
"narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "1355a0cbfeac61d785b7183c0caaec1f97361b43",
|
"rev": "bfb7a882678e518398ce9a31a881538679f6f092",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -375,21 +375,6 @@
|
||||||
"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": {
|
||||||
|
@ -493,8 +478,7 @@
|
||||||
"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,7 +3,6 @@
|
||||||
|
|
||||||
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";
|
||||||
|
@ -36,7 +35,6 @@
|
||||||
|
|
||||||
outputs = inputs@{
|
outputs = inputs@{
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
nur,
|
|
||||||
home-manager,
|
home-manager,
|
||||||
agenix,
|
agenix,
|
||||||
nix-flatpak,
|
nix-flatpak,
|
||||||
|
@ -59,7 +57,6 @@
|
||||||
./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,6 +13,10 @@
|
||||||
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,10 +20,6 @@
|
||||||
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;
|
||||||
};
|
};
|
||||||
|
@ -38,9 +34,5 @@
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
waydroid.enable = true;
|
waydroid.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
server = {
|
|
||||||
distrobox.enable = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,15 @@
|
||||||
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,6 +13,10 @@
|
||||||
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,9 +47,5 @@
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
waydroid.enable = true;
|
waydroid.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
server = {
|
|
||||||
distrobox.enable = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,15 @@
|
||||||
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;
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
}
|
|
|
@ -1,11 +1,10 @@
|
||||||
{ ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./chromium
|
./chromium
|
||||||
./firefox
|
|
||||||
./flatpak
|
./flatpak
|
||||||
./jetbrainsToolbox
|
./jetbrainsToolbox
|
||||||
./kitty
|
./kitty
|
||||||
];
|
];
|
||||||
}
|
}
|
|
@ -1,44 +0,0 @@
|
||||||
{ 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,6 +12,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
services.flatpak = {
|
services.flatpak = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
@ -20,15 +21,22 @@ 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 graalvm-ce];
|
home.packages = with pkgs; [jetbrains-toolbox];
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../common.nix
|
|
||||||
./apps
|
./apps
|
||||||
./editors
|
./editors
|
||||||
./desktop
|
./desktop
|
||||||
|
@ -17,5 +16,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ 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,20 +13,10 @@ 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 = {
|
# signing.signByDefault = true;
|
||||||
signByDefault = true;
|
|
||||||
key = "B19E3F4A2D806AB4793FDF2FC73D37CBED7BFC77";
|
|
||||||
};
|
|
||||||
|
|
||||||
extraConfig = {
|
|
||||||
url."https://invent.kde.org/".insteadOf = "kde:";
|
|
||||||
url."ssh://git@invent.kde.org/".pushInsteadOf = "kde:";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -1,7 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./steam
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
{ 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,10 +1,6 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
|
||||||
../common.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
time.timeZone = "Europe/Paris";
|
time.timeZone = "Europe/Paris";
|
||||||
|
|
||||||
|
@ -25,39 +21,13 @@
|
||||||
|
|
||||||
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;
|
||||||
|
@ -67,10 +37,6 @@
|
||||||
|
|
||||||
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,7 +2,6 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./apps
|
|
||||||
./desktop
|
./desktop
|
||||||
./hardware
|
./hardware
|
||||||
./server
|
./server
|
||||||
|
|
|
@ -26,6 +26,17 @@ 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,51 +11,41 @@ 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 = {
|
hardware.nvidia = {
|
||||||
graphics = {
|
# Modesetting is required.
|
||||||
enable = true;
|
modesetting.enable = true;
|
||||||
enable32Bit = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
nvidia-container-toolkit.enable = true;
|
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
||||||
|
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;
|
||||||
|
|
||||||
nvidia = {
|
# Use the NVidia open source kernel module (not to be confused with the
|
||||||
# Modesetting is required.
|
# independent third-party "nouveau" open source driver).
|
||||||
modesetting.enable = true;
|
# 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 = false;
|
||||||
|
|
||||||
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
# Enable the Nvidia settings menu,
|
||||||
# Enable this if you have graphical corruption issues or application crashes after waking
|
# accessible via `nvidia-settings`.
|
||||||
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
|
nvidiaSettings = true;
|
||||||
# of just the bare essentials.
|
|
||||||
powerManagement.enable = true;
|
|
||||||
|
|
||||||
# Fine-grained power management. Turns off GPU when not in use.
|
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
||||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||||
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,6 +12,7 @@ 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 = {
|
||||||
|
@ -27,4 +28,4 @@ in
|
||||||
#media-session.enable = true;
|
#media-session.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./distrobox
|
|
||||||
./docker
|
./docker
|
||||||
./ollama
|
|
||||||
./openssh
|
./openssh
|
||||||
];
|
];
|
||||||
}
|
}
|
|
@ -1,17 +0,0 @@
|
||||||
{ 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,8 +13,7 @@ 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" ];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -1,21 +0,0 @@
|
||||||
{ 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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
2027
overlays/kwin/5511.patch
Normal file
2027
overlays/kwin/5511.patch
Normal file
File diff suppressed because it is too large
Load diff
9
overlays/kwin/default.nix
Normal file
9
overlays/kwin/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
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
|
||||||
|
];
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
|
@ -1,30 +0,0 @@
|
||||||
## 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
|
|
|
@ -1,24 +0,0 @@
|
||||||
# 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
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
#!/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"
|
|
|
@ -1,6 +0,0 @@
|
||||||
[kdedev]
|
|
||||||
image=quay.io/fedora/fedora:latest
|
|
||||||
home="${HOME}/.distrobox_home/kdedev"
|
|
||||||
nvidia=true
|
|
||||||
root=false
|
|
||||||
pull=true
|
|
|
@ -1,19 +0,0 @@
|
||||||
# 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
|
|
|
@ -1,36 +0,0 @@
|
||||||
# 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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
|
@ -1,24 +0,0 @@
|
||||||
## 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