huge facelift time

This commit is contained in:
Serenity-F 2024-04-06 18:58:24 +10:00 • committed by Serenity
parent e6a69972a6
commit d3b738690a
17 changed files with 292 additions and 305 deletions

117
core/configuration.nix Normal file
View file

@ -0,0 +1,117 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}:
{
imports = [
# home-manager
inputs.home-manager.nixosModules.home-manager
# also split up configuration.nix and import pieces:
./users.nix
./packages.nix
];
security = {
rtkit.enable = true;
sudo.execWheelOnly = true;
};
time.timeZone = "Australia/Brisbane";
i18n.defaultLocale = "en_GB.UTF-8";
nixpkgs = {
# add overlays here
overlays = [
# to use 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 nixpkgs instance
config = {
allowUnfree = true;
permittedInsecurePackages = [
"schildichat-web-1.11.30-sc.2"
"electron-25.9.0"
];
};
};
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
nix.nixPath = ["/etc/nix/path"];
environment.etc =
lib.mapAttrs'
(name: value: {
name = "nix/path/${name}";
value.source = value.flake;
})
config.nix.registry;
nix.settings = {
cores = 0;
auto-optimise-store = true;
allowed-users = [ "@wheel" ];
experimental-features = [
"nix-command"
"flakes"
];
};
# services.flatpak.enable = true;
boot.binfmt.registrations.appimage = {
wrapInterpreterInShell = false;
interpreter = "${pkgs.appimage-run}/bin/appimage-run";
recognitionType = "magic";
offset = 0;
mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
magicOrExtension = ''\x7fELF....AI\x02'';
};
qt.style = "adwaita-dark";
sound.enable = true;
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
jack.enable = true;
pulse.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
# lowLatency.enable = true;
};
# disable these cuz they cause problems
# see: https://github.com/NixOS/nixpkgs/issues/180175
systemd.services = {
networkManager-wait-online.enable = lib.mkForce false;
systemd-networkd-wait-online.enable = lib.mkForce false;
};
# system.autoUpgrade = {
# enable = true;
# channel = "";
# };
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "23.11";
}

75
core/users.nix Normal file
View file

@ -0,0 +1,75 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}:
{
imports = [
inputs.home-manager.nixosModules.default
];
users.users = {
# To add new users, copy a block for
# an existing user, and adjust to needs.
# coffee = {
# description = "Coffee Beans";
# isNormalUser = true;
# initialPassword = "password";
# shell = pkgs.fish;
# extraGroups = [
# "wheel"
# "networkmanager"
# ];
# };
serenity = {
description = "Serenity Amalgam";
isNormalUser = true;
initialPassword = "password";
shell = pkgs.fish;
extraGroups = [
"wheel"
"networkmanager"
];
};
};
home-manager = {
extraSpecialArgs = { inherit inputs outputs; };
useGlobalPkgs = true;
useUserPackages = true;
users = {
# coffee = {
# imports = [ ../home/home.nix ];
# home = {
# username = "coffee";
# homeDirectory = "/home/coffee";
# stateVersion = "23.11";
# };
# };
serenity = {
imports = [ ../home/home.nix ];
home = {
username = "serenity";
homeDirectory = "/home/serenity";
stateVersion = "23.11";
};
};
};
};
}

66
flake.lock generated
View file

@ -20,6 +20,21 @@
"type": "github"
}
},
"hardware": {
"locked": {
"lastModified": 1712324865,
"narHash": "sha256-+BatEWd4HlMeK7Ora+gYIkarjxFVCg9oKrIeybHIIX4=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "f3b959627bca46a9f7052b8fbc464b8323e68c2c",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixos-hardware",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -90,31 +105,6 @@
"type": "github"
}
},
"hyprland-plugins": {
"inputs": {
"hyprland": [
"hyprland"
],
"systems": [
"hyprland-plugins",
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1712281995,
"narHash": "sha256-NoRAAqed5t3b3/Ebt5SW9BWh8dyKRmw9i9KjLcMdLsE=",
"owner": "hyprwm",
"repo": "hyprland-plugins",
"rev": "a7145f019254a7d953d56945c168d1bc698c35e4",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-plugins",
"type": "github"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
@ -188,22 +178,6 @@
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1712324865,
"narHash": "sha256-+BatEWd4HlMeK7Ora+gYIkarjxFVCg9oKrIeybHIIX4=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "f3b959627bca46a9f7052b8fbc464b8323e68c2c",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1711523803,
@ -224,24 +198,24 @@
"locked": {
"lastModified": 1712163089,
"narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=",
"owner": "NixOS",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "fd281bd6b7d3e32ddfa399853946f782553163b5",
"type": "github"
},
"original": {
"id": "nixpkgs",
"owner": "nixos",
"ref": "nixos-unstable",
"type": "indirect"
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"disko": "disko",
"hardware": "hardware",
"home-manager": "home-manager",
"hyprland": "hyprland",
"hyprland-plugins": "hyprland-plugins",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2"
}
},

View file

@ -1,12 +1,12 @@
{
description = "SerenityOS v0.3.2";
description = "SerenityOS v0.3.2-1";
inputs = {
# Nixpkgs and hardware specific configs
nixpkgs.url = "nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
hardware.url = "github:nixos/nixos-hardware";
# declarative disks
disko = {
url = "github:nix-community/disko";
@ -25,31 +25,42 @@
# url = "github:hyprwm/hyprland-plugins";
# inputs.hyprland.follows = "hyprland";
# };
};
outputs = {
nixpkgs,
nixos-hardware,
outputs = {
self,
hardware,
disko,
nixpkgs,
home-manager,
hyprland,
...
}:
{
} @ inputs: let
inherit (self) outputs;
in {
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
proserpina = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
proserpina = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
# > Our main nixos configuration files <
modules = [
./hosts/proserpina/configuration.nix
# nixos-hardware.nixosModules.$MODEL
disko.nixosModules.disko
inputs.home-manager.nixosModules.default
./hosts/proserpina/configuration.nix
];
};
hades = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
# > Our main nixos configuration files <
modules = [
disko.nixosModules.disko
./hosts/proserpina/configuration.nix
];
};
};
};
}

38
home/home.nix Normal file
View file

@ -0,0 +1,38 @@
# This is your home-manager configuration file
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
{
inputs,
lib,
config,
pkgs,
...
}: {
# You can import other home-manager modules here
imports = [
# If you want to use home-manager modules from other flakes (such as nix-colors):
# inputs.nix-colors.homeManagerModule
# You can also split up your configuration and import pieces of it here:
# ./nvim.nix
];
# Packages:
home.packages = with pkgs; [
steam
];
# Programs:
programs = {
home-manager.enable = true;
};
# Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
home.stateVersion = "23.11";
}

View file

@ -1,4 +1,4 @@
{ inputs, outputs, config, lib, pkgs, ... }:
{ inputs, outputs, lib, config, pkgs, ... }:
{
imports = [
@ -6,9 +6,9 @@
./hardware-configuration.nix
# "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/master.tar.gz"}/module.nix"
./disko-config.nix
./network-configuration.nix
# ./network-configuration.nix
../../modules/core
../../core/configuration.nix
];
@ -38,6 +38,14 @@
};
};
networking = {
hostName = "proserpina";
wireless.enable = false;
networkmanager = {
enable = true;
};
};
services.fstrim.enable = true;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
@ -72,4 +80,6 @@
};
};
system.stateVersion = "23.11";
}

View file

@ -7,8 +7,6 @@
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
# ./disko-config.sh
./disko-config.nix
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ];

View file

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

View file

@ -1,30 +0,0 @@
{ config, lib, pkgs, ... }:
{
imports = [
./services.nix
./display.nix
./user.nix
./packages
];
# Timezone & locale
time.timeZone = "Australia/Brisbane";
i18n.defaultLocale = "en_GB.UTF-8";
# security, apparently
security = {
rtkit.enable = true;
sudo.execWheelOnly = 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 = "23.11"; # Did you read the comment?
}

View file

@ -1,59 +0,0 @@
{pkgs, config, inputs, ... }:
{
imports = [
./packages.nix
];
nix = {
settings = {
cores = 0;
auto-optimise-store = true;
allowed-users = [
"@wheel"
];
experimental-features = [
"nix-command"
"flakes"
];
};
};
nixpkgs = {
overlays = [
];
config = {
allowUnfree = true;
permittedInsecurePackages = [
"schildichat-web-1.11.30-sc.2"
"electron-25.9.0"
];
};
};
qt.style = "adwaita-dark";
services.flatpak.enable = true;
boot.binfmt.registrations.appimage = {
wrapInterpreterInShell = false;
interpreter = "${pkgs.appimage-run}/bin/appimage-run";
recognitionType = "magic";
offset = 0;
mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
magicOrExtension = ''\x7fELF....AI\x02'';
};
system = {
stateVersion = "23.11";
# autoUpgrade = {
# enable = true;
# channel = "INSERT_CHANNEL";
# };
};
}

View file

@ -1,39 +0,0 @@
{ pkgs, lib, config, ... }:
{
imports = [
];
services = {
gvfs.enable = true;
dbus.enable = true;
avahi = {
enable = false;
nssmdns4 = false;
openFirewall = false;
};
locate = {
enable = false;
package = pkgs.plocate;
localuser = null;
};
};
# disable these cuz they cause problems
# see: https://github.com/NixOS/nixpkgs/issues/180175
systemd.services = {
networkManager-wait-online.enable = lib.mkForce false;
systemd-networkd-wait-online.enable = lib.mkForce false;
};
system.stateVersion = "23.11";
}

View file

@ -1,37 +0,0 @@
{ pkgs, config, inputs, ... }:
{
imports = [
# ../home
inputs.home-manager.nixosModules.default
];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = { inherit inputs; };
users.serenity = {
programs.home-manager.enable = true;
imports = [
../home
];
home = {
username = "serenity";
homeDirectory = "/home/serenity";
stateVersion = "23.11";
};
};
};
users.users.serenity = {
description = "Serenity Amalgam";
isNormalUser = true;
shell = pkgs.fish;
extraGroups = [
"wheel"
"networkmanager"
];
};
}

View file

@ -1,9 +0,0 @@
{ pkgs, lib, config, inputs, ... }:
{
imports = [
./hyprland.nix
];
}

View file

@ -1,45 +0,0 @@
{ pkgs, lib, config, inputs, ... }:
let
startupScript = pkgs.pkgs.writeShellScriptBin "start" ''
${pkgs.waybar}/bin/waybar &
${pkgs.swww}/bin/swww init &
sleep 1
${pkgs.swww}/bin/swww img ${./wallpaper.png} &
'';
in
{
wayland.windowManager.hyprland = {
enable = true;
plugins = [
inputs.hyprland-plugins.packages."${pkgs.system}".borders-plus-plus
inputs.hyprland-plugins.packages."${pkgs.system}".hyprbars
];
settings = {
exec-once = ''${startupScript}/bin/start'';
"plugin:borders-plus-plus" = {
add_borders = 1; # 0 - 9
# you can add up to 9 borders
"col.border_1" = "rgb(ffffff)";
"col.border_2" = "rgb(2222ff)";
# -1 means "default" as in the one defined in general:border_size
border_size_1 = 10;
border_size_2 = -1;
# makes outer edges match rounding of the parent. Turn on / off to better understand. Default = on.
natural_rounding = "yes";
};
};
};
}

View file

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 164 KiB

Before After
Before After