Add initial framework for config
This commit is contained in:
parent
98d6777b26
commit
5517f337e1
24 changed files with 190 additions and 284 deletions
41
README.md
41
README.md
|
@ -1,41 +0,0 @@
|
|||
### Old Hyprland config can be found [here](https://github.com/c4em/nixos-system-config/tree/deprecated)
|
||||
# nixos-system-config
|
||||
Modular NixOS configuration with dotfiles.
|
||||
## Usage
|
||||
You should have basic knowledge of NixOS before using this project. Begin at `configuration.nix` and read through the files by following imports.
|
||||
Everything should be commented. If something is not satisfactory, feel free to open up an issue or pull request.
|
||||
## Layout
|
||||
```
|
||||
/etc/nixos/
|
||||
├── configuration.nix ; master configuration file
|
||||
├── environments ; Desktop environment specific config
|
||||
│ └── plasma.nix
|
||||
├── hardware-configuration.nix ; Replace this with your current hardware-configuration.nix
|
||||
├── overlays ; Package overlays
|
||||
├── packages ; Package specifix configuration
|
||||
├── profile.nix ; Specify the profile to use
|
||||
├── profiles ; Profiles, for example for different machines or workflows
|
||||
│ └── workstation.nix
|
||||
├── sets ; Sets of packages to install
|
||||
│ ├── base
|
||||
│ │ ├── common.nix
|
||||
│ │ ├── devel.nix
|
||||
│ │ └── plasma.nix
|
||||
│ ├── devel
|
||||
│ │ ├── c.nix
|
||||
│ │ └── git.nix
|
||||
│ ├── drivers
|
||||
│ │ ├── nvidia.nix
|
||||
│ │ └── tablet.nix
|
||||
│ └── graphics
|
||||
│ ├── art.nix
|
||||
│ └── video.nix
|
||||
├── username.nix ; Set current user
|
||||
└── users ; Users
|
||||
└── user.nix
|
||||
```
|
||||
## Todo
|
||||
- [ ] Hyprland configuration
|
||||
- [ ] Clean up sets directory
|
||||
- [ ] Add screenshots to README.md
|
||||
- [ ] Home-manager configuration
|
20
common.nix
Normal file
20
common.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Common configuration for all systems
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
nix = {
|
||||
settings.auto-optimise-store = true;
|
||||
|
||||
# Clean generations older than a week
|
||||
gc = {
|
||||
automatic = false; # Flip this to do it automatically
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 7d";
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
# Master configuration file
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
# User configurations are stored under ./user/[username].nix
|
||||
# Set the corresponding value in ./username.nix
|
||||
user = import ./username.nix;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./users/${user}.nix
|
||||
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
|
||||
# Uncomment the profile you want to use
|
||||
./profiles/workstation.nix
|
||||
];
|
||||
|
||||
# General NixOS configuration
|
||||
nix = {
|
||||
settings.auto-optimise-store = true;
|
||||
# Automatically remove generations older than a week
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 7d";
|
||||
};
|
||||
};
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Use the unstable channel
|
||||
system.autoUpgrade = {
|
||||
enable = true;
|
||||
channel = "https://nixos.org/channels/nixos-unstable";
|
||||
};
|
||||
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "22.05";
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../sets/base/plasma.nix
|
||||
];
|
||||
|
||||
services.xserver.enable = true;
|
||||
services.xserver.displayManager.sddm.enable = true;
|
||||
services.xserver.desktopManager.plasma5.enable = true;
|
||||
}
|
60
flake.lock
Normal file
60
flake.lock
Normal file
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
"nodes": {
|
||||
"impermanence": {
|
||||
"locked": {
|
||||
"lastModified": 1684264534,
|
||||
"narHash": "sha256-K0zr+ry3FwIo3rN2U/VWAkCJSgBslBisvfRIPwMbuCQ=",
|
||||
"owner": "nix-community",
|
||||
"repo": "impermanence",
|
||||
"rev": "89253fb1518063556edd5e54509c30ac3089d5e6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "impermanence",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1686921029,
|
||||
"narHash": "sha256-J1bX9plPCFhTSh6E3TWn9XSxggBh/zDD4xigyaIQBy8=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c7ff1b9b95620ce8728c0d7bd501c458e6da9e04",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-23.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"impermanence": "impermanence",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"unstable": "unstable"
|
||||
}
|
||||
},
|
||||
"unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1686960236,
|
||||
"narHash": "sha256-AYCC9rXNLpUWzD9hm+askOfpliLEC9kwAo7ITJc4HIw=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "04af42f3b31dba0ef742d254456dc4c14eedac86",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
26
flake.nix
Normal file
26
flake.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
description = "Modular multi-purpose NixOS configuration.";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
|
||||
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
||||
# https://nixos.wiki/wiki/Impermanence
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, ... }@attrs: let
|
||||
user = import ./username.nix;
|
||||
in {
|
||||
# Debugging VM configuration
|
||||
nixosConfigurations.qemu-vm = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
./users/${user}.nix
|
||||
./common.nix
|
||||
./systems/qemu-vm.nix
|
||||
./systems/hardware/qemu-vm.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
35
packages/vim/package.nix
Normal file
35
packages/vim/package.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.variables = { EDITOR = "vim"; };
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
((vim_configurable.override { }).customize{
|
||||
name = "vim";
|
||||
|
||||
vimrcConfig.packages.plugins = with pkgs.vimPlugins; {
|
||||
start = [ vim-nix ];
|
||||
opt = [];
|
||||
};
|
||||
|
||||
vimrcConfig.customRC = ''
|
||||
syntax on
|
||||
set tabstop=4
|
||||
set shiftwidth=4 smarttab
|
||||
set expandtab
|
||||
set noswapfile
|
||||
set incsearch
|
||||
set noerrorbells
|
||||
set smartindent
|
||||
set number
|
||||
set relativenumber
|
||||
set nobackup
|
||||
set undofile
|
||||
set scrolloff=8
|
||||
set sidescrolloff=8
|
||||
set fileencoding='utf-8'
|
||||
set nohlsearch
|
||||
'';
|
||||
})
|
||||
];
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
# Select profile from ./profiles/ directory
|
||||
"workstation"
|
|
@ -1,69 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# Environments
|
||||
../environments/plasma.nix # KDE/Plasma
|
||||
# ../environments/hyprland.nix # Todo
|
||||
|
||||
# Package sets
|
||||
../sets/base/common.nix
|
||||
../sets/drivers/nvidia.nix
|
||||
../sets/drivers/tablet.nix
|
||||
../sets/base/devel.nix
|
||||
../sets/graphics/art.nix
|
||||
../sets/graphics/video.nix
|
||||
];
|
||||
|
||||
# Bootloader
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
||||
|
||||
# Hostname
|
||||
networking.hostName = "nixos";
|
||||
|
||||
# Networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Timezone
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
# Locale
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
console.keyMap = "uk";
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "de_DE.UTF-8";
|
||||
LC_IDENTIFICATION = "de_DE.UTF-8";
|
||||
LC_MEASUREMENT = "de_DE.UTF-8";
|
||||
LC_MONETARY = "de_DE.UTF-8";
|
||||
LC_NAME = "de_DE.UTF-8";
|
||||
LC_NUMERIC = "de_DE.UTF-8";
|
||||
LC_PAPER = "de_DE.UTF-8";
|
||||
LC_TELEPHONE = "de_DE.UTF-8";
|
||||
LC_TIME = "de_DE.UTF-8";
|
||||
};
|
||||
|
||||
services.xserver = {
|
||||
layout = "gb";
|
||||
xkbVariant = "";
|
||||
};
|
||||
|
||||
# Nvidia
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware.opengl.enable = true;
|
||||
hardware.nvidia.modesetting.enable = true;
|
||||
|
||||
# Enable audio
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
firefox
|
||||
neofetch
|
||||
tree
|
||||
];
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../devel/git.nix
|
||||
../devel/c.nix
|
||||
];
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
kate
|
||||
];
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
gcc
|
||||
clang
|
||||
clang-tools
|
||||
gnumake
|
||||
];
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
];
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware.opengl.enable = true;
|
||||
hardware.nvidia.modesetting.enable = true;
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
hardware.opentabletdriver.enable = true;
|
||||
hardware.opentabletdriver.daemon.enable = true;
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
krita
|
||||
gimp
|
||||
];
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
kdenlive
|
||||
];
|
||||
}
|
||||
|
11
sets/meta/sysadmin.nix
Normal file
11
sets/meta/sysadmin.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
htop
|
||||
wget
|
||||
curl
|
||||
];
|
||||
|
||||
services.openssh.enable = true;
|
||||
}
|
|
@ -5,30 +5,24 @@
|
|||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/56ec7666-a2ea-4e77-9015-00151b9b7884";
|
||||
{ device = "/dev/disk/by-uuid/126df580-7925-4bb4-b280-9e7e1c238d3e";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=@" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot/efi" =
|
||||
{ device = "/dev/disk/by-uuid/F076-283D";
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/8F2D-7123";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
fileSystems."/mnt/vault" = {
|
||||
device = "/dev/disk/by-uuid/048d175b-0e3e-4ec7-955b-3d9a45f9f237";
|
||||
fsType = "xfs";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
|
@ -36,8 +30,7 @@
|
|||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp34s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
13
systems/qemu-vm.nix
Normal file
13
systems/qemu-vm.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../sets/meta/sysadmin.nix
|
||||
../packages/vim/package.nix
|
||||
];
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/vda";
|
||||
|
||||
time.timeZone = "Europe/Berlin";
|
||||
}
|
|
@ -1,2 +1,2 @@
|
|||
# Select user from the ./users/ directory
|
||||
# Select the user from the ./users directory
|
||||
"user"
|
||||
|
|
1
users/none.nix
Normal file
1
users/none.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ }
|
|
@ -1,30 +1,20 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
];
|
||||
|
||||
{
|
||||
users.users.user = {
|
||||
isNormalUser = true;
|
||||
initialPassword = "ReplaceMe";
|
||||
description = "user";
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
"audio"
|
||||
"video"
|
||||
"docker"
|
||||
"podman"
|
||||
"networkmanager"
|
||||
"kvm"
|
||||
"libvirt"
|
||||
"plugdev"
|
||||
];
|
||||
};
|
||||
|
||||
# Set to false to disable sudo password prompt
|
||||
security = {
|
||||
sudo.wheelNeedsPassword = true;
|
||||
};
|
||||
|
||||
# home-manager.users.user = {
|
||||
# home.stateVersion = "22.11";
|
||||
# };
|
||||
|
||||
# programs.home-manager.enable = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue