desktop-2024-08-30-13-22-30

This commit is contained in:
Alexander Szczepanski
2024-08-30 13:22:30 +02:00
parent adf3ae9214
commit 4298f9dc77
12 changed files with 198 additions and 82 deletions

View File

@ -1,9 +1,6 @@
{ config, pkgs, lib, ... }:
let
unstable = import <nixos-unstable> { config.allowUnfree = true; };
in
{
environment.systemPackages = with unstable.pkgs; [
environment.systemPackages = with pkgs.unstable; [
brave
chromium
firefox

View File

@ -1,7 +1,4 @@
{ config, pkgs, lib, ... }:
let
unstable = import <nixos-unstable> {};
in
{
environment.shells = with pkgs; [ bashInteractive zsh ];
@ -61,7 +58,7 @@ in
networkmanager.dns = "none";
};
environment.systemPackages = with unstable.pkgs; [
environment.systemPackages = with pkgs.unstable; [
ack
borgbackup
borgmatic

View File

@ -1,10 +1,4 @@
{ config, pkgs, lib, ... }:
let
unstable = import <nixos-unstable> {
config.allowUnfree = true;
};
nix-gaming = import (builtins.fetchTarball "https://github.com/fufexan/nix-gaming/archive/master.tar.gz");
in
{ config, pkgs, lib, outputs, ... }:
{
programs = {
gamescope = {
@ -13,21 +7,22 @@ in
};
steam = {
enable = true;
package = unstable.pkgs.steam.override {
extraPkgs = pkgs: with unstable.pkgs; [
gamescope
mangohud
libkrb5
keyutils
package = pkgs.unstable.steam.override {
extraPkgs = pkgs: [
pkgs.gamescope
pkgs.mangohud
# libkrb5
# keyutils
];
};
};
};
environment.systemPackages = with unstable.pkgs; [
environment.systemPackages = with pkgs.unstable; [
(lutris.override {
extraPkgs = pkgs: with unstable.pkgs; [
gamescope mangohud
extraPkgs = pkgs: [
pkgs.gamescope
pkgs.mangohud
];
})

View File

@ -1,7 +1,4 @@
{ config, pkgs, lib, ... }:
# let
# unstable = import <nixos-unstable> { config.allowUnfree = true; };
# in
{ pkgs, ... }:
{
virtualisation = {
libvirtd = {

View File

@ -1,7 +1,6 @@
{ config, pkgs, lib, ... }:
let unstable = import <nixos-unstable> { config.allowUnfree = true; };
in {
imports = [ <home-manager/nixos> ];
{ config, pkgs, inputs, home-manager, ... }:
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
networking = {
firewall.enable = false;
networkmanager = { enable = true; };
@ -62,7 +61,7 @@ in {
# };
};
environment.systemPackages = with unstable.pkgs; [
environment.systemPackages = with pkgs.unstable; [
alacritty
czkawka # fslint before
grsync
@ -83,7 +82,7 @@ in {
programs = {
vscode = {
enable = true;
package = unstable.pkgs.vscode;
package = pkgs.unstable.vscode;
};
mpv = {
@ -97,7 +96,7 @@ in {
kitty = {
enable = true;
package = unstable.pkgs.kitty;
package = pkgs.unstable.kitty;
extraConfig = ''
enable_audio_bell false

View File

@ -1,9 +1,15 @@
{ config, pkgs, lib, ... }:
{ config, pkgs, lib, inputs, ... }:
let
unstable = import <nixos-unstable> { config.allowUnfree = true; };
secrets = import ./secrets.nix;
in {
imports = [ <home-manager/nixos> ];
in
{
imports = [
inputs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
];
# Define a user account. Don't forget to set a password with passwd.
users = {
@ -41,15 +47,12 @@ in {
nix-ld.enable = true;
};
home-manager.useUserPackages = true;
home-manager.useGlobalPkgs = true;
environment.pathsToLink = [ "/share/zsh" ];
home-manager.users.alex = { pkgs, ... }: {
home = {
stateVersion = "24.05";
packages = with unstable.pkgs; [
packages = with pkgs.unstable; [
# atop
broot
ffmpeg
@ -141,7 +144,7 @@ in {
plugins = [
{
name = "powerlevel10k";
src = unstable.pkgs.zsh-powerlevel10k;
src = pkgs.unstable.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{
@ -159,10 +162,6 @@ in {
"-g C" = "| wc -l";
"-g G" = "| grep --ignore-case";
bat = "upower -i /org/freedesktop/UPower/devices/battery_BAT0";
brightness-max =
"echo 4794 | sudo tee /sys/class/backlight/intel_backlight/brightness";
brightness-power-save =
"echo 2300 | sudo tee /sys/class/backlight/intel_backlight/brightness";
ff = "find . -type f -iname";
l = "eza --group-directories-first -l -g";
ll = "eza --group-directories-first -l -g";

39
flake.lock generated
View File

@ -1,5 +1,42 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1720042825,
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.05",
"repo": "home-manager",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1724878143,
"narHash": "sha256-UjpKo92iZ25M05kgSOw/Ti6VZwpgdlOa73zHj8OcaDk=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "95c3dfe6ef2e96ddc1ccdd7194e3cda02ca9a8ef",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "master",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1724855419,
@ -34,6 +71,8 @@
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
}

View File

@ -5,31 +5,42 @@
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:nixos/nixos-hardware/master";
# # Home manager
# home-manager.url = "github:nix-community/home-manager/release-24.05";
# home-manager.inputs.nixpkgs.follows = "nixpkgs-unstable";
# Home manager
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self
, nixpkgs
, nixpkgs-unstable
# , home-manager
, ...
} @ inputs:
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, nixos-hardware, ... } @ inputs:
let
inherit (self) outputs;
system = "x86_64-linux";
# Supported systems for your flake packages, shell, etc.
systems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs systems;
in
{
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
overlays = import ./overlays { inherit inputs; };
nixosConfigurations = {
desktop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs outputs; };
# > Our main nixos configuration file <
modules = [ ./machine/desktop.nix ];
modules = [
./machine/desktop.nix
];
};
};
};

View File

@ -0,0 +1,39 @@
# 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 = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/d43faf8e-ec90-4735-a1a4-aff6897604b2";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-ba8eb308-e85f-4cee-9993-88c5ba0966ea".device = "/dev/disk/by-uuid/ba8eb308-e85f-4cee-9993-88c5ba0966ea";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/1838-7DA8";
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.enp8s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -1,18 +1,41 @@
{ config, pkgs, lib, ... }:
{ config, pkgs, inputs, outputs, ... }:
let
secrets = import ../configs/secrets.nix;
be = import ../configs/borg-exclude.nix;
wireguard = import ../configs/wireguard.nix;
unstable = import <nixos-unstable> { config.allowUnfree = true; };
in
{
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
};
};
imports = [
<nixos-hardware/common/cpu/amd/default.nix>
<nixos-hardware/common/cpu/amd/pstate.nix>
<nixos-hardware/common/cpu/amd/zenpower.nix>
<nixos-hardware/common/pc/ssd>
/etc/nixos/hardware-configuration.nix
./desktop-hardware-configuration.nix
inputs.nixos-hardware.nixosModules.common-cpu-amd
inputs.nixos-hardware.nixosModules.common-cpu-amd-pstate
inputs.nixos-hardware.nixosModules.common-cpu-amd-zenpower
inputs.nixos-hardware.nixosModules.common-pc-ssd
../configs/browser.nix
../configs/common.nix
../configs/docker.nix
@ -23,16 +46,8 @@ in
../configs/user.nix
];
# nixpkgs.localSystem = {
# gcc.arch = "znver2";
# gcc.tune = "znver2";
# system = "x86_64-linux";
# };
nix.settings.system-features = [ "nixos-test" "benchmark" "big-parallel" "kvm" "gccarch-znver2" ];
nixpkgs.config.allowUnfree = true;
boot = {
initrd.systemd.enable = true;
loader = {
@ -50,7 +65,7 @@ in
description = "AMDGPU Control Daemon";
wantedBy = [ "multi-user.target" ];
after = [ "multi-user.target" ];
serviceConfig = { ExecStart = "${unstable.pkgs.lact}/bin/lact daemon"; };
serviceConfig = { ExecStart = "${pkgs.unstable.lact}/bin/lact daemon"; };
};
};
@ -79,7 +94,7 @@ in
keyMap = "us";
};
environment.systemPackages = with unstable.pkgs; [
environment.systemPackages = with pkgs.unstable; [
lact
amdgpu_top

23
overlays/default.nix Normal file
View File

@ -0,0 +1,23 @@
# This file defines overlays
{ inputs, ... }: {
# This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs final.pkgs;
# This one contains whatever you want to overlay
# You can change versions, add patches, set compilation flags, anything really.
# https://nixos.wiki/wiki/Overlays
modifications = final: prev: {
# example = prev.example.overrideAttrs (oldAttrs: rec {
# ...
# });
};
# When applied, the unstable nixpkgs set (declared in the flake inputs) will
# be accessible through 'pkgs.unstable'
unstable-packages = final: _prev: {
unstable = import inputs.nixpkgs-unstable {
system = final.system;
config.allowUnfree = true;
};
};
}

5
pkgs/default.nix Normal file
View File

@ -0,0 +1,5 @@
# Custom packages, that can be defined similarly to ones from nixpkgs
# You can build them using 'nix build .#example'
pkgs: {
# example = pkgs.callPackage ./example { };
}