Skip to content

Commit 0f1b616

Browse files
authored
Dev: clean modules and fix update script (#152)
* dev: try again tpm2 unlock * wip: clean modules * wip: fix infrec * wip: web server on NUC * fix: clean games module * fix: split nixos scripts * wip: update script * wip: update script * NUC: use Kmscon * fix: re-add locale * fix: move nixos-update to systemPackages * wip: update script * wip: use partlabels * wip: disable plymouth * wip: fix os error 2 * wip: fix os error 2 * wip: fix os error 2 * wip: fix os error 2 * wip: reinstall secureboot * wip: format * wip: format * wip: rebuild script * wip: rebuild script * wip: rebuild script
1 parent 2728e85 commit 0f1b616

File tree

105 files changed

+1889
-2654
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1889
-2654
lines changed

docs/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,10 @@
1616
# 20-5-2024
1717
- improved server systems
1818
- reorganized nixos modules
19+
20+
# 15-12-2024
21+
- reorganized all modules
22+
- started detailled doc
23+
- enabled secureboot on linux
24+
- simplified systems
25+
- optimised imports

docs/INSTALL.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# NIXOS :
2+
3+
## Secure Boot :
4+
5+
After normal installation, do this :
6+
1. make sure to have secure boot enabled in setup mode
7+
2. run :
8+
```
9+
nix-shell -p sbctl --run "sudo sbctl create-keys"
10+
nix-shell -p sbctl --run "sudo sbctl enroll-keys --microsoft"
11+
nix-shell -p sbctl --run "sbctl status"
12+
```
13+
this ensure that secure boot is enabled.
14+
more details [in lanzaboote] (https://github.com/nix-community/lanzaboote/blob/master/docs/QUICK_START.md)
15+
16+
## TPM2 unlock :
17+
18+
with this config you can use luks passwordless :
19+
`sudo systemd-cryptenroll /dev/$DISK --tpm2-device=auto --tpm2-pcrs=0+2+7` is run after every rebuild, so you are safe !
20+
see [this reddit thread](https://www.reddit.com/r/NixOS/comments/xrgszw/nixos_full_disk_encryption_with_tpm_and_secure/) for details !
21+
22+

docs/TODO.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,31 @@
22

33
## bugfixes :
44

5-
- [X] fix `sshd` : fixed, added `neededForBoot` to bindMount
6-
- [X] fix samba Workgroup share not working
75
- [ ] fix `gamemoded.service` : `gamemoded.service: Main process exited, code=exited, status=1/FAILURE`
86

97
## improvements :
108

9+
### NixOS
1110
- [X] Linux : reworked core modules
12-
- [ ] Linux Desktop : rework desktop modules
13-
- [ ] Linux Desktop : Theming
14-
- [ ] Linux : use BTRFS instead of ZFS for root
15-
- [ ] Linux : ZFS use better defaults
11+
- [X] Linux Desktop : rework desktop modules
12+
- [X] Linux : use BTRFS instead of ZFS for root
13+
- [X] Update github actions
1614
- [ ] Make a documentation
17-
- [ ] Update github actions
15+
16+
### Web
17+
- [ ] web use latest nixpkgs;
18+
- [ ] web hosts services
19+
### Users
20+
- [ ] Users use HM options
1821
- [ ] Option to enable or disable users by systems
19-
- [ ] Darwin : Auto Update command
2022
- [ ] Home-Manager : set useGlobalPkgs to true and remove nixpkgs options.
2123

22-
## Possible :
24+
### MacOS
25+
- [ ] Darwin : Auto Update command
26+
2327

28+
## Possible :
2429
- [ ] Server : pufferpanel for game servers
2530
- [ ] map unfree programs to unfree automatically
2631
- [ ] better git hooks (prepush/precommit)
32+
- [ ] split very long module

flake.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,33 @@
99
nixpkgs.url = "github:nixos/nixpkgs/refs/tags/24.05";
1010
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
1111
# HM :
12-
home-manager.url = "github:nix-community/home-manager/release-24.05";
13-
home-manager.inputs.nixpkgs.follows = "nixpkgs";
12+
home-manager = {
13+
url = "github:nix-community/home-manager/release-24.05";
14+
inputs.nixpkgs.follows = "nixpkgs";
15+
};
1416
## Secure boot
15-
lanzaboote.url = "github:nix-community/lanzaboote/v0.4.1";
16-
lanzaboote.inputs.nixpkgs.follows = "nixpkgs";
17+
lanzaboote = {
18+
url = "github:nix-community/lanzaboote/v0.4.1";
19+
inputs.nixpkgs.follows = "nixpkgs";
20+
};
1721
## Plasma
1822
# TODO : nix run github:pjones/plasma-manager
19-
# plasma-manager.url = "github:pjones/plasma-manager";
20-
# plasma-manager.inputs.nixpkgs.follows = "nixpkgs";
21-
# plasma-manager.inputs.home-manager.follows = "home-manager";
23+
# plasma-manager = {
24+
# url = "github:pjones/plasma-manager";
25+
# inputs.nixpkgs.follows = "nixpkgs";
26+
# home-manager.follows = "home-manager";
27+
# };
2228

2329
# macOS:
24-
# TODO : remove what's not useful
2530
nixpkgs-darwin.url = "github:nixos/nixpkgs/release-24.05";
26-
darwin.url = "github:LnL7/nix-darwin";
27-
darwin.inputs.nixpkgs.follows = "nixpkgs-darwin";
28-
home-manager-darwin.url = "github:nix-community/home-manager/release-24.05";
29-
home-manager-darwin.inputs.nixpkgs.follows = "nixpkgs-darwin";
31+
darwin = {
32+
url = "github:LnL7/nix-darwin";
33+
inputs.nixpkgs.follows = "nixpkgs-darwin";
34+
};
35+
home-manager-darwin = {
36+
url = "github:nix-community/home-manager/release-24.05";
37+
inputs.nixpkgs.follows = "nixpkgs-darwin";
38+
};
3039
mac-app-util.url = "github:hraban/mac-app-util";
3140
};
3241

modules/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# modules :
2+
3+
All configuration modules are independant and only imported if necessary.
4+
this is done so that non-imported modules don't get parsed if not in use (no web server parsing if no web server on the machine for example).
5+
6+
## linux
7+
this is our core linux config. maybe it could benefit from splitting in separate files for filesystems and other things
8+
9+
## desktop
10+
KDE desktop (for now). this is made for having a nice linux desktop
11+
12+
## games
13+
tools to better run games on nixos. requires (linux)[##linux].
14+
15+
## shared
16+
modules useful both in linux and macOS
17+
18+
## vm
19+
module to turn a system into a VM
20+
21+
## web
22+
a cool web/cloud server. linux only (relies on systemd). has no external dependencies.
23+
24+
## macos
25+
nix-darwin module for MacOS.

modules/desktop/default.nix

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# desktop.nix
2+
#
3+
#
4+
{
5+
config,
6+
pkgs,
7+
lib,
8+
...
9+
}:
10+
{
11+
options.desktop = with lib; {
12+
enable = mkEnableOption "desktop experience";
13+
};
14+
15+
config = lib.mkMerge [
16+
(lib.attrsets.optionalAttrs config.desktop.enable {
17+
18+
services = {
19+
displayManager.sddm = {
20+
enable = true;
21+
enableHidpi = true;
22+
autoNumlock = true;
23+
# this prevents issues with nvidia drivers
24+
wayland.enable =
25+
!(builtins.any (
26+
x: x == "nvidia"
27+
) config.services.xserver.videoDrivers);
28+
};
29+
};
30+
31+
# set tag for version
32+
system.nixos.tags = [ "Desktop" ];
33+
34+
#
35+
services.xserver = {
36+
enable = true;
37+
38+
# Enable Plasma 5 or 6
39+
desktopManager.plasma5 = {
40+
enable = true;
41+
useQtScaling = true;
42+
# default font with extra
43+
notoPackage = pkgs.noto-fonts-lgc-plus;
44+
};
45+
# remove xterm
46+
desktopManager.xterm.enable = false;
47+
excludePackages = [ pkgs.xterm ];
48+
49+
};
50+
51+
# enable plasma
52+
qt = {
53+
enable = true;
54+
platformTheme = "kde";
55+
};
56+
57+
# enable tools
58+
programs = {
59+
dconf.enable = true;
60+
kdeconnect.enable = true;
61+
partition-manager.enable = true;
62+
};
63+
64+
# remove useless KDE packages
65+
environment = {
66+
plasma5.excludePackages =
67+
with pkgs.libsForQt5;
68+
[
69+
oxygen
70+
khelpcenter
71+
plasma-browser-integration
72+
print-manager
73+
kio-extras
74+
khelpcenter
75+
kwallet
76+
kwallet-pam
77+
kate
78+
okular
79+
]
80+
++ (with pkgs.libsForQt5; [ kemoticons ]);
81+
82+
systemPackages =
83+
with pkgs;
84+
[
85+
lightly-boehs
86+
papirus-icon-theme
87+
libsForQt5.kcalc
88+
]
89+
++ map callPackage [
90+
./packages/vapor-theme.nix
91+
# ./packages/plasma-drawer.nix
92+
# ./packages/ditto-menu.nix
93+
];
94+
};
95+
})
96+
(lib.attrsets.optionalAttrs (!config.desktop.enable) {
97+
system.nixos.tags = [ "Headless" ];
98+
services.xserver.enable = false;
99+
100+
services.kmscon = {
101+
enable = true;
102+
fonts = [
103+
{
104+
name = "Source Code Pro";
105+
package = pkgs.source-code-pro;
106+
}
107+
{
108+
name = "nerdfont";
109+
package = pkgs.nerdfonts;
110+
}
111+
];
112+
};
113+
})
114+
];
115+
}

platform/linux/desktop/kde/plasma-drawer.nix renamed to modules/desktop/packages/plasma-drawer.nix

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,4 @@ stdenv.mkDerivation rec {
2424
zip
2525
];
2626

27-
# TODO :
28-
# installPhase = ''
29-
# mkdir -p $out/share/plasma/plasmoids/plasma-drawer
30-
# cd $src
31-
# ${lib.getBin libsForQt5.kpackage}/bin/kpackagetool -i $out/share/plasma/plasmoids/plasma-drawer
32-
# '';
3327
}
File renamed without changes.

0 commit comments

Comments
 (0)