first commit

This commit is contained in:
Frost-Phoenix 2023-11-05 11:40:44 +01:00
commit 58a3f28118
72 changed files with 3082 additions and 0 deletions

View file

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_lqx;
boot.initrd.kernelModules = [ "amdgpu" ];
}

View file

@ -0,0 +1,24 @@
{ pkgs, ... }: {
systemd.packages = with pkgs; [
(cloudflare-warp.overrideAttrs (old: {
src = pkgs.fetchurl {
url = "https://pkg.cloudflareclient.com/pool/jammy/main/c/cloudflare-warp/cloudflare-warp_2023.3.470-1_amd64.deb";
sha256 = "sha256-AYnmisEQKFiEB2iRJifEqRbdzAyBcfrU0ITeUokKLag=";
};
unpackPhase = null;
}))
];
systemd.services."warp-svc".wantedBy = [ "multi-user.target" ];
environment.systemPackages = with pkgs;[
(cloudflare-warp.overrideAttrs (old: {
src = pkgs.fetchurl {
url = "https://pkg.cloudflareclient.com/pool/jammy/main/c/cloudflare-warp/cloudflare-warp_2023.3.470-1_amd64.deb";
sha256 = "sha256-AYnmisEQKFiEB2iRJifEqRbdzAyBcfrU0ITeUokKLag=";
};
unpackPhase = null;
}))
];
}

36
modules/core/default.nix Normal file
View file

@ -0,0 +1,36 @@
{ inputs
, nixpkgs
, self
, ...
}:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
lib = nixpkgs.lib;
in
{
nixos = nixpkgs.lib.nixosSystem {
specialArgs = { inherit self inputs; };
modules =
[ (import ./bootloader.nix) ]
++ [ (import ./hardware.nix) ]
++ [ (import ./xserver.nix) ]
++ [ (import ./steam.nix) ]
++ [ (import ./network.nix) ]
++ [ (import ./pipewire.nix) ]
++ [ (import ./program.nix) ]
++ [ (import ./../home/package/python.nix) ]
++ [ (import ./security.nix) ]
++ [ (import ./services.nix) ]
++ [ (import ./system.nix) ]
++ [ (import ./user.nix) ]
++ [ (import ./wayland.nix) ]
++ [ (import ./cloudflare-warp.nix) ]
++ [ (import ./virtualization.nix) ]
++ [ (import ./../../hosts/nixos/hardware-configuration.nix) ]
;
};
}

10
modules/core/hardware.nix Executable file
View file

@ -0,0 +1,10 @@
{ pkgs, ... }: {
# hardware.video.hidpi.enable = true;
hardware.opengl.enable = true;
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true;
hardware.opengl.extraPackages = with pkgs; [
amdvlk
];
powerManagement.cpuFreqGovernor = "performance";
}

7
modules/core/network.nix Executable file
View file

@ -0,0 +1,7 @@
{ ... }: {
networking = {
hostName = "nixos";
networkmanager.enable = true;
nameservers = [ "1.1.1.1" ];
};
}

11
modules/core/pipewire.nix Executable file
View file

@ -0,0 +1,11 @@
{ ... }: {
sound.enable = true;
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
lowLatency.enable = true;
};
}

9
modules/core/program.nix Executable file
View file

@ -0,0 +1,9 @@
{ pkgs, ... }: {
programs.dconf.enable = true;
programs.zsh.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryFlavor = "gtk2";
};
}

View file

@ -0,0 +1,5 @@
{ ... }: {
security.rtkit.enable = true;
security.sudo.enable = true;
security.pam.services.swaylock = { };
}

7
modules/core/services.nix Executable file
View file

@ -0,0 +1,7 @@
{...}: {
services = {
gvfs.enable = true;
gnome.gnome-keyring.enable = true;
dbus.enable = true;
};
}

13
modules/core/steam.nix Normal file
View file

@ -0,0 +1,13 @@
{ pkgs, lib, ... }: {
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = false;
};
programs.gamemode.enable = true;
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"steam"
"steam-original"
"steam-runtime"
];
}

37
modules/core/system.nix Normal file
View file

@ -0,0 +1,37 @@
{ self
, pkgs
, lib
, inputs
, ...
}: {
imports = [ inputs.nix-gaming.nixosModules.default ];
nix = {
settings = {
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
substituters = [ "https://nix-gaming.cachix.org" ];
trusted-public-keys = [ "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" ];
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
};
nixpkgs = {
overlays = [
self.overlays.default
inputs.nur.overlay
];
};
environment.systemPackages = with pkgs; [
wget
git
];
time.timeZone = "Europe/Paris";
i18n.defaultLocale = "en_US.UTF-8";
nixpkgs.config.allowUnfree = true;
system.stateVersion = "23.05";
}

38
modules/core/user.nix Normal file
View file

@ -0,0 +1,38 @@
{ pkgs
, inputs
, ...
}:
let
name = "FrostPhoenix";
username = "frostphoenix";
#email = "t@gmail.com";
initialPassword = "dreamX";
packages = with pkgs; [
fish
];
in
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = { inherit inputs; };
users.${username} = {
imports = [ (import ./../home) ];
home.username = username;
home.homeDirectory = "/home/${username}";
home.stateVersion = "22.11";
programs.home-manager.enable = true;
};
};
users.users.${username} = {
isNormalUser = true;
initialPassword = initialPassword;
description = name;
extraGroups = [ "networkmanager" "wheel" ];
shell = pkgs.zsh;
};
users.users.root.initialPassword = initialPassword;
nix.settings.allowed-users = [ "frostphoenix" ];
}

View file

@ -0,0 +1,33 @@
{ config, pkgs, ... }:
{
# Add user to libvirtd group
users.users.frostphoenix.extraGroups = [ "libvirtd" ];
# Install necessary packages
environment.systemPackages = with pkgs; [
virt-manager
virt-viewer
spice
spice-gtk
spice-protocol
win-virtio
win-spice
gnome.adwaita-icon-theme
virtiofsd
];
# Manage the virtualisation services
virtualisation = {
libvirtd = {
enable = true;
qemu = {
swtpm.enable = true;
ovmf.enable = true;
ovmf.packages = [ pkgs.OVMFFull.fd ];
};
};
spiceUSBRedirection.enable = true;
};
services.spice-vdagentd.enable = true;
}

12
modules/core/wayland.nix Normal file
View file

@ -0,0 +1,12 @@
{ inputs, pkgs, ... }:
{
programs.hyprland.enable = true;
xdg.portal = {
enable = true;
wlr.enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-hyprland
# pkgs.xdg-desktop-portal-gtk
];
};
}

17
modules/core/xserver.nix Normal file
View file

@ -0,0 +1,17 @@
{ pkgs, ... }: {
services.xserver = {
enable = true;
layout = "us";
videoDrivers = [ "amdgpu" ];
displayManager.autoLogin = {
enable = true;
user = "frostphoenix";
};
libinput = {
enable = true;
mouse = {
accelProfile = "flat";
};
};
};
}