Skip to content

Commit fb37e4a

Browse files
committed
Initial configuration
1 parent 2c10837 commit fb37e4a

File tree

5 files changed

+512
-0
lines changed

5 files changed

+512
-0
lines changed

configuration.nix

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
{ config, pkgs, ... }:
2+
3+
{
4+
imports =
5+
[ # Include the results of the hardware scan.
6+
./hardware-configuration.nix
7+
];
8+
9+
nix.settings.experimental-features = [ "nix-command" "flakes" ];
10+
11+
# Bootloader.
12+
boot.loader.systemd-boot.enable = true;
13+
boot.loader.efi.canTouchEfiVariables = true;
14+
15+
networking.hostName = "liskov"; # Define your hostname.
16+
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
17+
18+
# Configure network proxy if necessary
19+
# networking.proxy.default = "http://user:password@proxy:port/";
20+
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
21+
22+
# Enable networking
23+
networking.networkmanager.enable = true;
24+
25+
# Set your time zone.
26+
time.timeZone = "Europe/Belgrade";
27+
28+
# Select internationalisation properties.
29+
i18n.defaultLocale = "en_US.UTF-8";
30+
31+
i18n.extraLocaleSettings = {
32+
LC_ADDRESS = "en_GB.UTF-8";
33+
LC_IDENTIFICATION = "en_GB.UTF-8";
34+
LC_MEASUREMENT = "en_GB.UTF-8";
35+
LC_MONETARY = "en_GB.UTF-8";
36+
LC_NAME = "en_GB.UTF-8";
37+
LC_NUMERIC = "en_GB.UTF-8";
38+
LC_PAPER = "en_GB.UTF-8";
39+
LC_TELEPHONE = "en_GB.UTF-8";
40+
LC_TIME = "en_GB.UTF-8";
41+
};
42+
43+
# NVIDIA GPU drivers
44+
hardware.graphics.enable = true;
45+
hardware.nvidia = {
46+
# Modesetting is required.
47+
modesetting.enable = true;
48+
49+
# Use proprietary driver
50+
open = false;
51+
package = config.boot.kernelPackages.nvidiaPackages.production;
52+
53+
nvidiaSettings = true;
54+
55+
# Setup PRIME
56+
prime = {
57+
# Offload mode: discrete GPU used for specific tasks only
58+
offload = {
59+
enable = true;
60+
enableOffloadCmd = true;
61+
};
62+
63+
intelBusId = "PCI:0:2:0";
64+
nvidiaBusId = "PCI:1:0:0";
65+
};
66+
};
67+
services.xserver.videoDrivers = [ "nvidia" ];
68+
69+
# SDDM login manager with wayland support
70+
# services.displayManager.sddm = {
71+
# enable = true;
72+
# wayland.enable = true;
73+
#
74+
# theme = "catppuccin-frappe";
75+
# package = pkgs.kdePackages.sddm;
76+
# };
77+
78+
services.greetd = {
79+
enable = true;
80+
81+
settings = rec {
82+
initial_session = {
83+
command = "${pkgs.sway}/bin/sway";
84+
user = "buglight";
85+
};
86+
87+
default_session = initial_session;
88+
};
89+
};
90+
91+
security.polkit.enable = true;
92+
93+
# Enable the gnome-keyring secrets vault.
94+
# Will be exposed through DBus to programs willing to store secrets.
95+
services.gnome.gnome-keyring.enable = true;
96+
97+
# Enable CUPS to print documents.
98+
services.printing.enable = true;
99+
100+
# Enable sound with pipewire.
101+
hardware.pulseaudio.enable = false;
102+
security.rtkit.enable = true;
103+
services.pipewire = {
104+
enable = true;
105+
alsa.enable = true;
106+
alsa.support32Bit = true;
107+
pulse.enable = true;
108+
# If you want to use JACK applications, uncomment this
109+
#jack.enable = true;
110+
111+
# use the example session manager (no others are packaged yet so this is enabled by default,
112+
# no need to redefine it in your config for now)
113+
#media-session.enable = true;
114+
};
115+
116+
# Enable touchpad support (enabled default in most desktopManager).
117+
services.libinput.enable = true;
118+
119+
# Define a user account. Don't forget to set a password with ‘passwd’.
120+
users.users.buglight = {
121+
isNormalUser = true;
122+
description = "Dani";
123+
extraGroups = [ "networkmanager" "wheel" "video" ];
124+
packages = with pkgs; [
125+
];
126+
};
127+
128+
# Install firefox.
129+
programs.firefox.enable = true;
130+
131+
programs.light.enable = true;
132+
133+
# Allow unfree packages
134+
nixpkgs.config.allowUnfree = true;
135+
136+
# System packages
137+
environment.systemPackages = with pkgs; [
138+
# basic utilities
139+
git
140+
neovim
141+
142+
# media
143+
pulseaudio
144+
145+
# notification system for sway
146+
mako
147+
148+
# wl-copy and wl-paste for copy/paste from stdin / stdout
149+
wl-clipboard
150+
151+
# sddm catpuccin theme
152+
(catppuccin-sddm.override {
153+
flavor = "frappe";
154+
font = "Noto Sans";
155+
fontSize = "16";
156+
# background = "${./wallpaper.png}";
157+
loginBackground = false;
158+
})
159+
];
160+
161+
# Some programs need SUID wrappers, can be configured further or are
162+
# started in user sessions.
163+
# programs.mtr.enable = true;
164+
# programs.gnupg.agent = {
165+
# enable = true;
166+
# enableSSHSupport = true;
167+
# };
168+
169+
# List services that you want to enable:
170+
171+
# Enable the OpenSSH daemon.
172+
# services.openssh.enable = true;
173+
174+
# Open ports in the firewall.
175+
# networking.firewall.allowedTCPPorts = [ ... ];
176+
# networking.firewall.allowedUDPPorts = [ ... ];
177+
# Or disable the firewall altogether.
178+
# networking.firewall.enable = false;
179+
180+
# This value determines the NixOS release from which the default
181+
# settings for stateful data, like file locations and database versions
182+
# on your system were taken. It‘s perfectly fine and recommended to leave
183+
# this value at the release version of the first install of this system.
184+
# Before changing this value read the documentation for this option
185+
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
186+
system.stateVersion = "24.11"; # Did you read the comment?
187+
188+
}

flake.lock

Lines changed: 49 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: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
inputs = {
3+
# NixOS official package source, using the nixos-24.11 branch here
4+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
5+
6+
# home-manager, used for managing user configuration
7+
home-manager = {
8+
url = "github:nix-community/home-manager/release-24.11";
9+
inputs.nixpkgs.follows = "nixpkgs";
10+
};
11+
};
12+
13+
outputs = { self, nixpkgs, home-manager, ... }@inputs: {
14+
nixosConfigurations.liskov = nixpkgs.lib.nixosSystem {
15+
system = "x86_64-linux";
16+
modules = [
17+
./configuration.nix
18+
19+
home-manager.nixosModules.home-manager
20+
{
21+
home-manager.useGlobalPkgs = true;
22+
home-manager.useUserPackages = true;
23+
24+
home-manager.users.buglight = import ./home.nix;
25+
}
26+
];
27+
};
28+
};
29+
}

hardware-configuration.nix

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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" "nvme" "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/359118a8-89c7-42e0-a5bf-044f052765dc";
18+
fsType = "ext4";
19+
};
20+
21+
fileSystems."/boot" =
22+
{ device = "/dev/disk/by-uuid/8BB0-199D";
23+
fsType = "vfat";
24+
options = [ "fmask=0077" "dmask=0077" ];
25+
};
26+
27+
swapDevices =
28+
[ { device = "/dev/disk/by-uuid/520be2cf-b4a3-4c92-9403-a7016f5cbc0a"; }
29+
];
30+
31+
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
32+
# (the default) this is the recommended approach. When using systemd-networkd it's
33+
# still possible to use this option, but it's recommended to use it in conjunction
34+
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
35+
networking.useDHCP = lib.mkDefault true;
36+
# networking.interfaces.eno2.useDHCP = lib.mkDefault true;
37+
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
38+
39+
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
40+
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
41+
}

0 commit comments

Comments
 (0)