base: add existing config
This commit is contained in:
commit
0c2d3b2e78
34 changed files with 437 additions and 0 deletions
19
LICENSE
Normal file
19
LICENSE
Normal file
|
@ -0,0 +1,19 @@
|
|||
Copyright (c) 2024 Luxzi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
3
README.md
Normal file
3
README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# NixOS configuration files
|
||||
|
||||
Configured for KDE Plasma Wayland on Nvidia.
|
48
flake.lock
generated
Normal file
48
flake.lock
generated
Normal file
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"nodes": {
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1721804110,
|
||||
"narHash": "sha256-i4jINRazBKPqlaS+qhlP+kV/UHEq3vs5itfpblqu4ZM=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "af70fc502a15d7e1e4c5a4c4fc8e06c2ec561e0c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1721562059,
|
||||
"narHash": "sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "68c9ed8bbed9dfce253cc91560bf9043297ef2fe",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
28
flake.nix
Normal file
28
flake.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
description = "Luxzi's NixOS system configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, ... }:
|
||||
let
|
||||
lib = nixpkgs.lib;
|
||||
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
||||
in {
|
||||
nixosConfigurations = {
|
||||
nixos = lib.nixosSystem {
|
||||
specialArgs = { inherit self; };
|
||||
modules = [ ./nixos/configuration.nix ];
|
||||
};
|
||||
};
|
||||
homeConfigurations = {
|
||||
luxzi = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [ ./home-manager/home.nix ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
14
home-manager/home.nix
Normal file
14
home-manager/home.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
./packages/packages.nix
|
||||
];
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
home.username = "luxzi";
|
||||
home.homeDirectory = "/home/luxzi";
|
||||
home.stateVersion = "24.05";
|
||||
}
|
19
home-manager/packages/git.nix
Normal file
19
home-manager/packages/git.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "luxzi";
|
||||
userEmail = "lesson085@gmail.com";
|
||||
aliases = {
|
||||
pf = "push --force";
|
||||
kl = "log --show-signature";
|
||||
};
|
||||
signing = {
|
||||
key = "$HOME/.ssh/luxzi";
|
||||
};
|
||||
extraConfig = {
|
||||
init.defaultBranch = "main";
|
||||
};
|
||||
};
|
||||
}
|
20
home-manager/packages/packages.nix
Normal file
20
home-manager/packages/packages.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
./zsh.nix
|
||||
./git.nix
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
rustup
|
||||
hyfetch
|
||||
nix-output-monitor
|
||||
alvr
|
||||
firefox
|
||||
tree
|
||||
vesktop
|
||||
kitty
|
||||
];
|
||||
}
|
26
home-manager/packages/zsh.nix
Normal file
26
home-manager/packages/zsh.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
plugins = [ "git" ];
|
||||
theme = "af-magic";
|
||||
};
|
||||
shellAliases = {
|
||||
hm-switch = "home-manager switch --flake $HOME/.dotfiles";
|
||||
nx-switch = "sudo nixos-rebuild switch --flake $HOME/.dotfiles";
|
||||
nx-boot = "sudo nixos-rebuild boot --flake $HOME/.dotfiles";
|
||||
nx-clean = "sudo nix-collect-garbage --delete-old && nix-collect-garbage --delete-old";
|
||||
hm-clean = "home-manager remove-generations";
|
||||
gl-switch = "sudo nixos-rebuild switch --flake $HOME/.dotfiles && home-manager switch --flake $HOME/.dotfiles";
|
||||
gl-clean = "sudo nix-collect-garbage --delete-old && nix-collect-garbage --delete-old && home-manager remove-generations";
|
||||
snv = "sudo -E nvim";
|
||||
sen = "sudo -E";
|
||||
};
|
||||
};
|
||||
}
|
25
nixos/configuration.nix
Normal file
25
nixos/configuration.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ config, lib, pkgs, self, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware/hardware.nix
|
||||
./environments/plasma-wayland.nix
|
||||
./users/luxzi.nix
|
||||
./services/services.nix
|
||||
./programs/programs.nix
|
||||
./misc/misc.nix
|
||||
];
|
||||
|
||||
# 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 does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
||||
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
||||
# to actually do that.
|
||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||
system.stateVersion = "24.05"; # Did you read the comment?
|
||||
}
|
||||
|
14
nixos/environments/plasma-wayland.nix
Normal file
14
nixos/environments/plasma-wayland.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
services.displayManager.sddm.enable = true;
|
||||
services.displayManager.sddm.wayland.enable = true;
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
|
||||
environment.plasma6.excludePackages = with pkgs; [
|
||||
plasma-browser-integration
|
||||
konsole
|
||||
];
|
||||
}
|
5
nixos/hardware/audio.nix
Normal file
5
nixos/hardware/audio.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
hardware.pulseaudio.enable = false;
|
||||
}
|
14
nixos/hardware/fstab.nix
Normal file
14
nixos/hardware/fstab.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/6f9a4486-8f14-468f-aecb-5e0df8af2309";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/4A4B-5B94";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
}
|
13
nixos/hardware/hardware.nix
Normal file
13
nixos/hardware/hardware.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
./modules.nix
|
||||
./fstab.nix
|
||||
./audio.nix
|
||||
./network.nix
|
||||
./intel.nix
|
||||
./nvidia.nix
|
||||
];
|
||||
}
|
6
nixos/hardware/intel.nix
Normal file
6
nixos/hardware/intel.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
{
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
13
nixos/hardware/modules.nix
Normal file
13
nixos/hardware/modules.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
}
|
5
nixos/hardware/network.nix
Normal file
5
nixos/hardware/network.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
}
|
13
nixos/hardware/nvidia.nix
Normal file
13
nixos/hardware/nvidia.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
hardware.graphics.enable = true;
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = false;
|
||||
powerManagement.finegrained = false;
|
||||
open = false;
|
||||
nvidiaSettings = false;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
}
|
5
nixos/misc/locale.nix
Normal file
5
nixos/misc/locale.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
}
|
10
nixos/misc/misc.nix
Normal file
10
nixos/misc/misc.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
./time.nix
|
||||
./locale.nix
|
||||
./nixconfig.nix
|
||||
];
|
||||
}
|
6
nixos/misc/nixconfig.nix
Normal file
6
nixos/misc/nixconfig.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
}
|
5
nixos/misc/time.nix
Normal file
5
nixos/misc/time.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
time.timeZone = "America/New_York";
|
||||
}
|
5
nixos/programs/dconf.nix
Normal file
5
nixos/programs/dconf.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs.dconf.enable = true;
|
||||
}
|
8
nixos/programs/gpg.nix
Normal file
8
nixos/programs/gpg.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
}
|
8
nixos/programs/nix-ld.nix
Normal file
8
nixos/programs/nix-ld.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.nix-ld = {
|
||||
enable = true;
|
||||
libraries = with pkgs; [];
|
||||
};
|
||||
}
|
29
nixos/programs/programs.nix
Normal file
29
nixos/programs/programs.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
./nix-ld.nix
|
||||
./dconf.nix
|
||||
./gpg.nix
|
||||
./steam.nix
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
wget
|
||||
curl
|
||||
git
|
||||
neovim
|
||||
fira-code-nerdfont
|
||||
cmake
|
||||
ninja
|
||||
libgcc
|
||||
gnumake
|
||||
topgrade
|
||||
unzip
|
||||
patchelf
|
||||
wl-clipboard
|
||||
jdk17
|
||||
jre8
|
||||
];
|
||||
}
|
5
nixos/programs/steam.nix
Normal file
5
nixos/programs/steam.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs.steam.enable = true;
|
||||
}
|
9
nixos/services/boot.nix
Normal file
9
nixos/services/boot.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.systemd-boot.configurationLimit = 10;
|
||||
boot.loader.systemd-boot.editor = false;
|
||||
boot.loader.efi.efiSysMountPoint = "/boot";
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
}
|
5
nixos/services/cups.nix
Normal file
5
nixos/services/cups.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
services.printing.enable = true;
|
||||
}
|
7
nixos/services/firewall.nix
Normal file
7
nixos/services/firewall.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
networking.firewall.enable = false;
|
||||
networking.firewall.allowedTCPPorts = [];
|
||||
networking.firewall.allowedUDPPorts = [];
|
||||
}
|
5
nixos/services/libinput.nix
Normal file
5
nixos/services/libinput.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
services.libinput.enable = true;
|
||||
}
|
6
nixos/services/networkmanager.nix
Normal file
6
nixos/services/networkmanager.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
networking.hostName = "nixos";
|
||||
networking.networkmanager.enable = true;
|
||||
}
|
11
nixos/services/pipewire.nix
Normal file
11
nixos/services/pipewire.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
audio.enable = true;
|
||||
pulse.enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
};
|
||||
}
|
13
nixos/services/services.nix
Normal file
13
nixos/services/services.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
./boot.nix
|
||||
./pipewire.nix
|
||||
./cups.nix
|
||||
./firewall.nix
|
||||
./libinput.nix
|
||||
./networkmanager.nix
|
||||
];
|
||||
}
|
15
nixos/users/luxzi.nix
Normal file
15
nixos/users/luxzi.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ self, pkgs, ... }:
|
||||
|
||||
{
|
||||
users.users.luxzi = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
||||
shell = pkgs.zsh;
|
||||
packages = [
|
||||
self.inputs.home-manager.packages.${pkgs.system}.home-manager
|
||||
];
|
||||
};
|
||||
|
||||
environment.shells = with pkgs; [ zsh ];
|
||||
programs.zsh.enable = true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue