uuuupdate

This commit is contained in:
Ranomier 2024-10-06 02:44:35 +02:00
parent 6e143facef
commit 63c50cfa2a
27 changed files with 314 additions and 257 deletions

View file

@ -2,41 +2,47 @@
######
inputs = {
######
# NOTE: Replace "nixos-23.11" with that which is in system.stateVersion of
# configuration.nix. You can also use latter versions if you wish to
# upgrade.
# INFO: Use github:org/repo/?ref=<tag> to pin releases.
# Main nix package repository
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
# ready made hardware configurations. e.G.: Power saving
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
# NixOS unstable channel
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
# ready made hardware configurations. e.G.: Power saving
nixos-hardware = {
url = "github:NixOS/nixos-hardware/master";
};
# for managing flatpaks, like which ones are installed and which not
nix-flatpak = {
url = "github:gmodena/nix-flatpak";
};
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
# NixOS unstable channel
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
};
#######
outputs =
#######
{ self, nixpkgs, nixos-hardware, nixpkgs-unstable, nix-flatpak, home-manager, ... } @ inputs:
let
{
self,
nixpkgs,
nixos-hardware,
nixpkgs-unstable,
nix-flatpak,
home-manager,
...
} @ inputs: let
# Supported systems for your flake packages, shell, etc.
systems = [
"aarch64-linux"
# "aarch64-linux"
"x86_64-linux"
];
# 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;
@ -46,7 +52,7 @@
#packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
# Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt'
#formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;};
@ -60,7 +66,6 @@
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
# FIXME replace with your hostname
crocoite = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
modules = [

View file

@ -1,11 +1,15 @@
# 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")
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["nvme" "ehci_pci" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
@ -13,22 +17,21 @@
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/c772918e-3832-45ae-8c97-05b3d837ed8b";
fileSystems."/" = {
device = "/dev/disk/by-uuid/c772918e-3832-45ae-8c97-05b3d837ed8b";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-3b194756-e29b-425a-b088-0a0468840011".device = "/dev/disk/by-uuid/3b194756-e29b-425a-b088-0a0468840011";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/5DF2-A721";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/5DF2-A721";
fsType = "vfat";
options = ["fmask=0022" "dmask=0022"];
};
swapDevices = [];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

View file

@ -1,4 +1,9 @@
{ pkgs, overlays, inputs, ... }: {
{
pkgs,
overlays,
inputs,
...
}: {
#MANPAGER='nvim +Man!'
# This value determines the NixOS release from which the default
@ -41,6 +46,7 @@
../modules/sec_auth/ssh.nix
../modules/software/software.nix
../modules/software/virt.nix
../modules/software/game.nix
../modules/software/audio_video.nix
../modules/software/obs-studio.nix

View file

@ -1,5 +1,8 @@
{ config, pkgs, ... }:
{
config,
pkgs,
...
}: {
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.systemd-boot.configurationLimit = 20;

View file

@ -32,6 +32,5 @@
# It's still possible to open the bootloader list by pressing any key
# It will just not appear on screen unless a key is pressed
loader.timeout = 0;
};
}

View file

@ -1,5 +1,8 @@
{ pkgs, lib, ... }:
{
pkgs,
lib,
...
}: {
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
@ -30,8 +33,8 @@
# networking.interfaces.enp5s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
# Open ports in the firewall.
#networking.firewall.allowedTCPPorts = [ 8080 ];
#networking.firewall.allowedUDPPorts = [ 8080 ];
networking.firewall.allowedTCPPorts = [8080];
networking.firewall.allowedUDPPorts = [8080];
# Or disable the firewall altogether.
# networking.firewall.enable = false;

View file

@ -1,31 +1,60 @@
{lib, ...}: {
services.flatpak.enable = true;
services.flatpak.update.auto.enable = false;
services.flatpak.uninstallUnmanaged = true;
services.flatpak.remotes = lib.mkOptionDefault [
{ name = "flathub-beta";
location = "https://flathub.org/beta-repo/flathub-beta.flatpakrepo"; }
{ name = "flathub";
location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; }
{
name = "flathub-beta";
location = "https://flathub.org/beta-repo/flathub-beta.flatpakrepo";
}
{
name = "flathub";
location = "https://dl.flathub.org/repo/flathub.flatpakrepo";
}
];
services.flatpak.packages = [
{ origin = "flathub"; appId = "com.github.tchx84.Flatseal"; } # flatpak permisssion gui
{ origin = "flathub"; appId = "com.mojang.Minecraft"; } # Lego for adults
{ origin = "flathub"; appId = "de.schmidhuberj.DieBahn"; } # Public transport connection viewer
{ origin = "flathub"; appId = "com.github.hugolabe.Wike"; } # Wikpedia, but in nice
{
origin = "flathub";
appId = "com.github.tchx84.Flatseal";
} # flatpak permisssion gui
{
origin = "flathub";
appId = "com.mojang.Minecraft";
} # Lego for adults
{
origin = "flathub";
appId = "de.schmidhuberj.DieBahn";
} # Public transport connection viewer
{
origin = "flathub";
appId = "com.github.hugolabe.Wike";
} # Wikpedia, but in nice
#{ origin = "flathub"; appId = "com.jeffser.Alpaca"; } # Local chat AI
{ origin = "flathub"; appId = "io.gpt4all.gpt4all"; } # Local chat AI
{ origin = "flathub"; appId = "md.obsidian.Obsidian"; } # note taking and brain organising
{
origin = "flathub";
appId = "io.gpt4all.gpt4all";
} # Local chat AI
{
origin = "flathub";
appId = "md.obsidian.Obsidian";
} # note taking and brain organising
# messenger
{ origin = "flathub"; appId = "org.signal.Signal"; }
{ origin = "flathub"; appId = "org.telegram.desktop"; }
{ origin = "flathub"; appId = "dev.vencord.Vesktop"; } # More usable discord for linux
{
origin = "flathub";
appId = "org.signal.Signal";
}
{
origin = "flathub";
appId = "org.telegram.desktop";
}
{
origin = "flathub";
appId = "dev.vencord.Vesktop";
} # More usable discord for linux
#"com.obsproject.Studio" #this is another way to write it
];
}

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
# Enable common container config files in /etc/containers
virtualisation.containers.enable = true;
virtualisation = {

View file

@ -1,7 +1,10 @@
{ config, pkgs, ... }: {
{
config,
pkgs,
...
}: {
# creates the file /etc/current-system-packages which then contains all installed packages and versions
environment.etc."current-system-packages".text =
let
environment.etc."current-system-packages".text = let
packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
sortedUnique = builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages);
formatted = builtins.concatStringsSep "\n" sortedUnique;

View file

@ -1,6 +1,5 @@
# TODO refine firejail it seems that / is not shielded enough and app armor does not work
{ pkgs, ... }:
{
{pkgs, ...}: {
programs.firejail = {
enable = true;
wrappedBinaries = {
@ -57,5 +56,4 @@
whitelist ''${HOME}/Downloads
'';
};
}

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
services.greetd = {

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
programs.ssh = {
startAgent = true;
enableAskPassword = true;
@ -18,7 +17,6 @@
lxqt.lxqt-openssh-askpass
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
# Define a user account. Don't forget to set a password with passwd.
users.users.ranomier = {
isNormalUser = true;
@ -48,7 +47,6 @@
security.apparmor.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
@ -52,5 +51,7 @@
environment.systemPackages = with pkgs; [
helvum
easyeffects
pwvucontrol
lxqt.pavucontrol-qt
];
}

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
nix.extraOptions = ''
plugin-files = ${pkgs.nix-doc}/lib/libnix_doc_plugin.so
'';

View file

@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
# to run normal external binaries
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [

View file

@ -1,5 +1,8 @@
{ pkgs, config, ... }:
{
pkgs,
config,
...
}: {
environment.systemPackages = [
(pkgs.wrapOBS {
plugins = with pkgs.obs-studio-plugins; [

View file

@ -1,17 +1,14 @@
{ pkgs, inputs, config, ... }: let
{
pkgs,
inputs,
config,
...
}: let
unstable_list = [inputs.nixpkgs-unstable.legacyPackages."x86_64-linux".neovim];
in {
# also opens the TCP and UDP port from 1714 to 1764
programs.kdeconnect.enable = true;
# for running android apps
virtualisation.waydroid.enable =
true; # also starts the systemd service waydroid-container
# virt manager, for running VM's
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
environment.pathsToLink = ["/share/foot"];
# List packages installed in system profile. To search, run:
@ -21,7 +18,9 @@ in {
export GDK_BACKEND='x11'
exec "${pkgs.amberol}/bin/amberol" "$@"
'';
in with pkgs; [
in
with pkgs;
[
# low level stuff
efibootmgr
#exfat
@ -61,7 +60,6 @@ in {
home-manager
# move to homemanager?
lxqt.pavucontrol-qt
mumble
amberol_wrapper
amberol
@ -72,8 +70,8 @@ in {
keepassxc
#minecraft
element-desktop
] ++ unstable_list;
]
++ unstable_list;
fonts.packages = with pkgs; [
noto-fonts

14
modules/software/virt.nix Normal file
View file

@ -0,0 +1,14 @@
{
pkgs,
inputs,
config,
...
}: {
# for running android apps
virtualisation.waydroid.enable =
true; # also starts the systemd service waydroid-container
# virt manager, for running VM's
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
}

View file

@ -1,10 +1,11 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
hardware.sane.enable = true; # enables support for SANE scanners
services.ipp-usb.enable = true; # enable usb support
hardware.sane.backends-package = pkgs.sane-backends.overrideAttrs (old: {
configureFlags = (old.configureFlags or []) ++ [
configureFlags =
(old.configureFlags or [])
++ [
# "--localstatedir=/var" # `sane-backends` puts e.g. lock files in here, must not be in /nix/store
# "--with-lockdir=/var/lock/sane" # `sane-backends` puts e.g. lock files in here, must not be in /nix/store

View file

@ -1,5 +1,4 @@
{pkgs, ...}: {
# Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session.
services.xserver.enable = false;