mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2024-11-15 13:23:11 +01:00
initial commit
This commit is contained in:
commit
9e4582d351
78
flake.lock
Normal file
78
flake.lock
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"home-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"utils": "utils"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1671335968,
|
||||||
|
"narHash": "sha256-V7mjlh7brp70elokmml6XzHinpTilkQJjiYIGjEmSGs=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "37713c6b04b963d41664e03576f73a18c9b0d224",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1671200928,
|
||||||
|
"narHash": "sha256-mZfzDyzojwj6I0wyooIjGIn81WtGVnx6+avU5Wv+VKU=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "757b82211463dd5ba1475b6851d3731dfe14d377",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1671215800,
|
||||||
|
"narHash": "sha256-2W54K41A7MefEaWzgL/TsaWlhKRK/RhWUybyOW4i0K8=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "9d692a724e74d2a49f7c985132972f991d144254",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-22.11",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"home-manager": "home-manager",
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"utils": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1667395993,
|
||||||
|
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
18
flake.nix
Normal file
18
flake.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
description = "My hardware setup";
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = github:nixos/nixpkgs/nixos-22.11;
|
||||||
|
home-manager.url = github:nix-community/home-manager;
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, home-manager }: {
|
||||||
|
nixosConfigurations = {
|
||||||
|
thinkpad = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
./hosts/thinkpad/configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
208
hosts/thinkpad/configuration.nix
Executable file
208
hosts/thinkpad/configuration.nix
Executable file
|
@ -0,0 +1,208 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ # Include the results of the hardware scan.
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
|
||||||
|
# Use the systemd-boot EFI boot loader.
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
networking.hostName = "thinkpad"; # Define your hostname.
|
||||||
|
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
||||||
|
networking.firewall = {
|
||||||
|
allowedUDPPorts = [51820];
|
||||||
|
checkReversePath = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Set your time zone.
|
||||||
|
time.timeZone = "Europe/Berlin";
|
||||||
|
|
||||||
|
# Select internationalisation properties.
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
console = {
|
||||||
|
font = "Lat2-Terminus16";
|
||||||
|
useXkbConfig = true; # use xkbOptions in tty.
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable the X11 windowing system.
|
||||||
|
services.xserver = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
displayManager = {
|
||||||
|
lightdm.enable = true;
|
||||||
|
defaultSession = "none+awesome";
|
||||||
|
};
|
||||||
|
windowManager.awesome = {
|
||||||
|
enable = true;
|
||||||
|
luaModules = with pkgs.luaPackages; [
|
||||||
|
luarocks
|
||||||
|
vicious
|
||||||
|
];
|
||||||
|
};
|
||||||
|
libinput.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Configure keymap in X11
|
||||||
|
services.xserver.layout = "us";
|
||||||
|
services.xserver.xkbVariant = "dvorak-alt-intl";
|
||||||
|
services.xserver.displayManager.sessionCommands =
|
||||||
|
"${pkgs.xorg.xmodmap}/bin/xmodmap ${pkgs.writeText "xkb-layout" ''
|
||||||
|
keycode 108 = Mode_switch
|
||||||
|
keycode 94 = Shift_L NoSymbol Shift_L
|
||||||
|
keysym a = a A adiaeresis Adiaeresis
|
||||||
|
keysym o = o O odiaeresis Odiaeresis
|
||||||
|
keysym u = u U udiaeresis Udiaeresis
|
||||||
|
keysym s = s S ssharp
|
||||||
|
''}";
|
||||||
|
|
||||||
|
# Enable sound.
|
||||||
|
sound.enable = true;
|
||||||
|
hardware.pulseaudio.enable = true;
|
||||||
|
hardware.bluetooth.enable = true;
|
||||||
|
|
||||||
|
environment.variables = { EDITOR = "vim"; };
|
||||||
|
|
||||||
|
# enable polkit
|
||||||
|
security.polkit.enable = true;
|
||||||
|
|
||||||
|
# Define a user account.
|
||||||
|
users.users.rouven = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [ "wheel" "video" "network" "libvirtd"];
|
||||||
|
};
|
||||||
|
|
||||||
|
# List packages installed in system profile. To search, run:
|
||||||
|
# $ nix search wget
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
((vim_configurable.override { }).customize{
|
||||||
|
name = "vim";
|
||||||
|
vimrcConfig.packages.myplugins = with pkgs.vimPlugins; {
|
||||||
|
start = [ vim-nix vim-lastplace ];
|
||||||
|
opt = [];
|
||||||
|
};
|
||||||
|
vimrcConfig.customRC = ''
|
||||||
|
|
||||||
|
" basic commands bound to uppercase key
|
||||||
|
command Q q
|
||||||
|
command W w
|
||||||
|
command Wq wq
|
||||||
|
command WQ wq
|
||||||
|
|
||||||
|
set number relativenumber
|
||||||
|
set tabstop=4
|
||||||
|
set shiftwidth=4
|
||||||
|
set smartcase
|
||||||
|
set colorcolumn=120
|
||||||
|
set nowrap
|
||||||
|
syntax on
|
||||||
|
highlight ColorColumn ctermbg=darkgray
|
||||||
|
|
||||||
|
nnoremap ; :
|
||||||
|
nnoremap : ;
|
||||||
|
vnoremap ; :
|
||||||
|
vnoremap : ;
|
||||||
|
|
||||||
|
" set space as leader
|
||||||
|
nnoremap <SPACE> <Nop>
|
||||||
|
let mapleader = " "
|
||||||
|
|
||||||
|
|
||||||
|
" beautify indents
|
||||||
|
:set list lcs=tab:\|\
|
||||||
|
|
||||||
|
"remove ex-mode shortcut
|
||||||
|
nmap Q <Nop>
|
||||||
|
|
||||||
|
" quickfixlist binds
|
||||||
|
nnoremap <C-j> :cnext<CR>
|
||||||
|
nnoremap <C-k> :cprev<CR>
|
||||||
|
|
||||||
|
" locallist binds
|
||||||
|
nnoremap <C-l> :lnext<CR>
|
||||||
|
nnoremap <C-h> :lprev<CR>
|
||||||
|
|
||||||
|
" split keybinds
|
||||||
|
nnoremap <leader>s :sp<CR>
|
||||||
|
nnoremap <leader>v :vs<CR>
|
||||||
|
|
||||||
|
nnoremap <leader>h <C-w>h
|
||||||
|
nnoremap <leader>j <C-w>j
|
||||||
|
nnoremap <leader>k <C-w>k
|
||||||
|
nnoremap <leader>l <C-w>l
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
)
|
||||||
|
# essentials
|
||||||
|
wget
|
||||||
|
git
|
||||||
|
gcc
|
||||||
|
htop
|
||||||
|
tmux
|
||||||
|
dig
|
||||||
|
traceroute
|
||||||
|
killall
|
||||||
|
xorg.xmodmap
|
||||||
|
# libs
|
||||||
|
libyubikey
|
||||||
|
libfido2
|
||||||
|
# dev
|
||||||
|
jdk
|
||||||
|
maven
|
||||||
|
# virtualisation
|
||||||
|
virt-manager
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.gnupg.agent = {
|
||||||
|
enable = true;
|
||||||
|
enableSSHSupport = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.light.enable = true; # display brightness manager
|
||||||
|
programs.kdeconnect.enable = true;
|
||||||
|
|
||||||
|
# List services that you want to enable:
|
||||||
|
services.blueman.enable = true;
|
||||||
|
services.devmon.enable = true;
|
||||||
|
services.pcscd.enable = true; # yubikey and smartcard stuff
|
||||||
|
services.printing.enable = true;
|
||||||
|
services.fprintd.enable = true;
|
||||||
|
|
||||||
|
# Automatically configure displays
|
||||||
|
services.autorandr.enable = true;
|
||||||
|
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||||
|
"steam"
|
||||||
|
"steam-original"
|
||||||
|
"steam-runtime"
|
||||||
|
"steam-run"
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.steam.enable = true;
|
||||||
|
|
||||||
|
services.udev.packages = [ pkgs.yubikey-personalization ];
|
||||||
|
|
||||||
|
virtualisation.libvirtd.enable = true;
|
||||||
|
|
||||||
|
# Copy the NixOS configuration file and link it from the resulting system
|
||||||
|
# (/run/current-system/configuration.nix). This is useful in case you
|
||||||
|
# accidentally delete configuration.nix.
|
||||||
|
system.copySystemConfiguration = true;
|
||||||
|
|
||||||
|
# This value determines the NixOS release from which the default
|
||||||
|
# settings for stateful data, like file locations and database versions
|
||||||
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||||
|
# this value at the release version of the first install of this system.
|
||||||
|
# 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.11"; # Did you read the comment?
|
||||||
|
|
||||||
|
}
|
||||||
|
|
38
hosts/thinkpad/hardware-configuration.nix
Executable file
38
hosts/thinkpad/hardware-configuration.nix
Executable file
|
@ -0,0 +1,38 @@
|
||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/8633a706-bf54-4d29-9fba-dbcffd723ab6";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/3A2E-1AB6";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# 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.enp0s31f6.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp9s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
Loading…
Reference in a new issue