Skip to content

Commit c14c90c

Browse files
committed
Initial set of files.
0 parents  commit c14c90c

5 files changed

Lines changed: 380 additions & 0 deletions

File tree

flake.lock

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

flake.nix

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
description = "A NixOS flake for pol's personal computer.";
3+
4+
inputs = {
5+
nixpkgs.url = "github:/nixos/nixpkgs/nixos-unstable";
6+
};
7+
8+
outputs = { self, nixpkgs, ... }@inputs: {
9+
10+
nixosConfigurations = {
11+
x260 = nixpkgs.lib.nixosSystem {
12+
system = "x86_64-linux";
13+
modules = [
14+
(import ./hosts/x260/configuration.nix)
15+
];
16+
specialArgs = { inherit inputs; };
17+
};
18+
};
19+
};
20+
}

hosts/x260/configuration.nix

Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
# Edit this configuration file to define what should be installed on
2+
# your system. Help is available in the configuration.nix(5) man page
3+
# and in the NixOS manual (accessible by running ‘nixos-help’).
4+
5+
{ config, pkgs, lib, ... }:
6+
7+
{
8+
imports =
9+
[ # Include the results of the hardware scan.
10+
"${builtins.fetchGit { url = "https://github.com/NixOS/nixos-hardware.git"; rev="5a7e613703ea349fd46b3fa2f3dfe3bd5444d591"; }}/lenovo/thinkpad/x260"
11+
./hardware-configuration.nix
12+
./packages.nix
13+
# ./php.nix
14+
];
15+
16+
# Use the GRUB 2 boot loader.
17+
# boot.loader.grub.enable = true;
18+
# boot.loader.grub.version = 2;
19+
boot.loader.systemd-boot.enable = true;
20+
# boot.loader.grub.useOSProber = true;
21+
boot.loader.efi.canTouchEfiVariables = true;
22+
# boot.loader.grub.efiSupport = true;
23+
# boot.loader.grub.efiInstallAsRemovable = true;
24+
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
25+
# Define on which hard drive you want to install Grub.
26+
# boot.loader.grub.device = "nodev"; # or "nodev" for efi only
27+
28+
networking.hostName = "x260"; # Define your hostname.
29+
networking.networkmanager.enable = true; # Enables wireless support via wpa_supplicant.
30+
31+
# Set your time zone.
32+
time.timeZone = "Europe/Brussels";
33+
34+
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
35+
# Per-interface useDHCP will be mandatory in the future, so this generated config
36+
# replicates the default behaviour.
37+
networking.useDHCP = false;
38+
# networking.interfaces.eno1.useDHCP = true;
39+
networking.interfaces.wlp4s0.useDHCP = true;
40+
41+
# Configure network proxy if necessary
42+
# networking.proxy.default = "http://user:password@proxy:port/";
43+
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
44+
45+
# Select internationalisation properties.
46+
# i18n.defaultLocale = "en_BE.UTF-8";
47+
# console = {
48+
# font = "Lat2-Terminus16";
49+
# keyMap = "us";
50+
# };
51+
52+
# Enable the X11 windowing system.
53+
services.xserver.enable = true;
54+
55+
services.xserver.displayManager.sddm.enable = true;
56+
services.xserver.desktopManager.plasma5.enable = true;
57+
58+
# services.xrdp.enable = true;
59+
# services.xrdp.defaultWindowManager = "startplasma-x11";
60+
61+
fonts.fonts = with pkgs; [
62+
jetbrains-mono
63+
hack-font
64+
noto-fonts
65+
noto-fonts-cjk
66+
noto-fonts-emoji
67+
liberation_ttf
68+
fira-code
69+
fira-code-symbols
70+
mplus-outline-fonts
71+
dina-font
72+
proggyfonts
73+
];
74+
75+
# Configure keymap in X11
76+
services.xserver.layout = "gb";
77+
services.xserver.xkbOptions = "eurosign:e";
78+
79+
# Enable CUPS to print documents.
80+
# services.printing.enable = true;
81+
82+
# Enable sound.
83+
#sound.enable = true;
84+
#hardware.pulseaudio.enable = true;
85+
#hardware.pulseaudio.support32Bit = true;
86+
#hardware.pulseaudio.package = pkgs.pulseaudioFull;
87+
88+
security.rtkit.enable = true;
89+
services.pipewire = {
90+
enable = true;
91+
alsa.enable = true;
92+
alsa.support32Bit = true;
93+
pulse.enable = true;
94+
# If you want to use JACK applications, uncomment this
95+
#jack.enable = true;
96+
97+
# use the example session manager (no others are packaged yet so this is enabled by default,
98+
# no need to redefine it in your config for now)
99+
# media-session.enable = true;
100+
};
101+
102+
# boot.extraModprobeConfig = ''
103+
# options snd_hda_intel enable=0,1
104+
# '';
105+
106+
# Enable touchpad support (enabled default in most desktopManager).
107+
# services.xserver.libinput.enable = true;
108+
109+
# Define a user account. Don't forget to set a password with ‘passwd’.
110+
users.users.pol = {
111+
isNormalUser = true;
112+
extraGroups = [
113+
"wheel"
114+
"audio"
115+
"docker"
116+
"sound"
117+
"video"
118+
"networkmanager"
119+
"input"
120+
"tty"
121+
"adbusers"
122+
];
123+
shell = pkgs.fish;
124+
};
125+
users.users.root.shell = pkgs.fish;
126+
security.sudo.wheelNeedsPassword = false; # Use 'sudo' without a password
127+
128+
programs.fish.shellAliases = {
129+
cat = "bat";
130+
ls = "exa";
131+
};
132+
133+
nixpkgs.config.allowUnfree = true;
134+
135+
# Nix Garbage Collector
136+
nix.gc = {
137+
automatic = true;
138+
dates = "weekly";
139+
options = "--delete-older-than 10d";
140+
};
141+
142+
powerManagement.enable = true;
143+
144+
programs.browserpass.enable = true;
145+
# Some programs need SUID wrappers, can be configured further or are
146+
# started in user sessions.
147+
# programs.mtr.enable = true;
148+
programs.gnupg.agent = {
149+
enable = true;
150+
enableSSHSupport = true;
151+
};
152+
153+
programs.fish.enable = true;
154+
programs.fish.promptInit = ''
155+
any-nix-shell fish --info-right | source
156+
'';
157+
158+
# List services that you want to enable:
159+
services.cron = {
160+
enable = true;
161+
systemCronJobs = [
162+
"0 * * * * root nix-channel --update"
163+
];
164+
};
165+
# Enable the OpenSSH daemon.
166+
services.openssh.enable = false;
167+
168+
networking.firewall.allowedTCPPorts = [ 3389 ];
169+
networking.firewall.checkReversePath = false;
170+
# Open ports in the firewall.
171+
# networking.firewall.allowedTCPPorts = [ ... ];
172+
# networking.firewall.allowedUDPPorts = [ ... ];
173+
# Or disable the firewall altogether.
174+
# networking.firewall.enable = false;
175+
176+
# This value determines the NixOS release from which the default
177+
# settings for stateful data, like file locations and database versions
178+
# on your system were taken. It‘s perfectly fine and recommended to leave
179+
# this value at the release version of the first install of this system.
180+
# Before changing this value read the documentation for this option
181+
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
182+
system.stateVersion = "21.05"; # Did you read the comment?
183+
184+
system.autoUpgrade = {
185+
enable = true;
186+
allowReboot = true;
187+
};
188+
189+
environment.etc."current-system-packages".text = with lib;
190+
let
191+
packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
192+
sortedUnique = builtins.sort builtins.lessThan (lib.unique packages);
193+
formatted = builtins.concatStringsSep "\n" sortedUnique;
194+
in
195+
formatted;
196+
197+
# system.copySystemConfiguration = true;
198+
199+
services.fwupd.enable = true;
200+
201+
virtualisation.docker.enable = true;
202+
203+
hardware.bluetooth.enable = true;
204+
205+
programs.adb.enable = true;
206+
207+
services.flatpak.enable = true;
208+
209+
networking.extraHosts =
210+
''
211+
127.0.0.1 collabora
212+
127.0.0.1 onlyoffice
213+
127.0.0.1 web
214+
'';
215+
216+
boot.kernel.sysctl = {
217+
"networking.enableIPv6" = false;
218+
"net.ipv6.conf.wlp4s0.disable_ipv6" = true;
219+
};
220+
221+
# networking.resolvconf.dnsExtensionMechanism = false;
222+
223+
nix = {
224+
extraOptions = ''
225+
experimental-features = nix-command flakes
226+
'';
227+
};
228+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Do not modify this file! It was generated by ‘nixos-generate-config’
2+
# and may be overwritten by future invocations. Please make changes
3+
# to /etc/nixos/configuration.nix instead.
4+
{ config, lib, pkgs, modulesPath, ... }:
5+
6+
{
7+
imports =
8+
[ (modulesPath + "/installer/scan/not-detected.nix")
9+
];
10+
11+
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
12+
boot.initrd.kernelModules = [ ];
13+
boot.kernelModules = [ "kvm-intel" ];
14+
boot.extraModulePackages = [ ];
15+
16+
fileSystems."/" =
17+
{ device = "/dev/disk/by-uuid/0441f1d3-2c4c-4038-a76b-b3b4beb755f9";
18+
fsType = "ext4";
19+
};
20+
21+
fileSystems."/boot" =
22+
{ device = "/dev/disk/by-uuid/7104-F69A";
23+
fsType = "vfat";
24+
};
25+
26+
fileSystems."/nix" =
27+
{ device = "/dev/disk/by-uuid/1c6de7e9-6a0d-47c5-ac8b-47f0ba6eecc2";
28+
fsType = "ext4";
29+
neededForBoot = true;
30+
options = [ "noatime" ];
31+
};
32+
33+
fileSystems."/home" =
34+
{ device = "/dev/disk/by-uuid/2523be1d-4020-4442-b6c6-6983137be565";
35+
fsType = "ext4";
36+
};
37+
38+
swapDevices =
39+
[ { device = "/dev/disk/by-uuid/d71fd11a-2609-4c3f-abc2-5ab794180d89"; }
40+
];
41+
42+
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
43+
}

hosts/x260/packages.nix

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Edit this configuration file to define what should be installed on
2+
# your system. Help is available in the configuration.nix(5) man page
3+
# and in the NixOS manual (accessible by running ‘nixos-help’).
4+
5+
{ config, pkgs, ... }:
6+
7+
{
8+
environment.systemPackages = with pkgs; [
9+
akregator
10+
android-studio
11+
any-nix-shell
12+
ark
13+
bat
14+
browserpass
15+
docker
16+
element-desktop
17+
exa
18+
firefox
19+
fish
20+
gimp
21+
git
22+
gitui
23+
gnupg
24+
google-chrome
25+
gradle # Java dependency manager
26+
graphviz
27+
htop
28+
jetbrains.datagrip
29+
jetbrains.jdk
30+
jetbrains.goland
31+
jetbrains.pycharm-professional
32+
jetbrains.phpstorm
33+
jetbrains.idea-ultimate
34+
jfsutils
35+
kate
36+
kgpg
37+
krdc
38+
# openjdk # Java Development Kit for Java
39+
krunner-pass
40+
maven # Java dependency manager
41+
neofetch
42+
okular
43+
p7zip
44+
pass
45+
plantuml
46+
plasma-browser-integration
47+
plasma-pass
48+
sddm-kcm
49+
signal-desktop
50+
slack
51+
spectacle
52+
tdesktop
53+
teams
54+
thunderbird-bin
55+
unrar
56+
vlc
57+
vscode
58+
wget
59+
wineWowPackages.stable
60+
yakuake
61+
];
62+
}

0 commit comments

Comments
 (0)