Added nh, added some options such as username and hardware config
This commit is contained in:
parent
b4f3add8ea
commit
ca216ad1dc
6 changed files with 46 additions and 25 deletions
25
flake.nix
25
flake.nix
|
|
@ -36,11 +36,20 @@
|
||||||
#};
|
#};
|
||||||
arm = "aarch64-linux";
|
arm = "aarch64-linux";
|
||||||
x86 = "x86_64-linux";
|
x86 = "x86_64-linux";
|
||||||
|
username = "kylekrein";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
homepc = nixpkgs.lib.nixosSystem {
|
"${username}-homepc" = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { hostname = "nixosbtw"; system = x86; inherit inputs; };
|
specialArgs = {
|
||||||
|
|
||||||
|
hwconfig = {
|
||||||
|
hostname = "${username}-homepc";
|
||||||
|
isLaptop = false;
|
||||||
|
system = x86;
|
||||||
|
};
|
||||||
|
inherit username;
|
||||||
|
inherit inputs; };
|
||||||
|
|
||||||
system = x86;
|
system = x86;
|
||||||
#pkgs = import nixpkgs {
|
#pkgs = import nixpkgs {
|
||||||
|
|
@ -61,8 +70,16 @@
|
||||||
#nix-flatpak.nixosModules.default
|
#nix-flatpak.nixosModules.default
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
mac = nixpkgs.lib.nixosSystem {
|
"${username}-mac" = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { hostname = "nixos-macbook-kylekrein"; system = arm; inherit inputs; };
|
specialArgs = {
|
||||||
|
hwconfig = {
|
||||||
|
hostname = "${username}-mac";
|
||||||
|
isLaptop = true;
|
||||||
|
system = arm;
|
||||||
|
};
|
||||||
|
inherit username;
|
||||||
|
inherit inputs; };
|
||||||
|
|
||||||
system = arm;
|
system = arm;
|
||||||
#pkgs = import nixpkgs {
|
#pkgs = import nixpkgs {
|
||||||
# system = arm;
|
# system = arm;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
{ config, pkgs, stylix, hostname, system, nixvim, inputs, ... }:
|
{ config, pkgs, stylix, hwconfig, username, nixvim, inputs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
|
|
@ -14,9 +14,9 @@
|
||||||
|
|
||||||
# Bootloader.
|
# Bootloader.
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = if hostname == "nixosbtw" then true else false;
|
boot.loader.efi.canTouchEfiVariables = if hwconfig.hostname == "${username}-homepc" then true else false;
|
||||||
|
|
||||||
networking.hostName = hostname;
|
networking.hostName = hwconfig.hostname;
|
||||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
|
|
||||||
# Configure network proxy if necessary
|
# Configure network proxy if necessary
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
services.udisks2.enable = true;
|
services.udisks2.enable = true;
|
||||||
|
|
||||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||||
users.users.kylekrein = {
|
users.users.${username} = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "Aleksandr Lebedev";
|
description = "Aleksandr Lebedev";
|
||||||
extraGroups = [ "networkmanager" "wheel" ];
|
extraGroups = [ "networkmanager" "wheel" ];
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
# Allow unfree packages
|
# Allow unfree packages
|
||||||
nixpkgs.system = system;
|
nixpkgs.system = hwconfig.system;
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
nixpkgs.config.allowBroken = true;
|
nixpkgs.config.allowBroken = true;
|
||||||
|
|
||||||
|
|
@ -182,6 +182,13 @@
|
||||||
shiftwidth = 4;
|
shiftwidth = 4;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.nh = {
|
||||||
|
enable = true;
|
||||||
|
clean.enable = true;
|
||||||
|
clean.extraArgs = "--keep-since 4d --keep 3";
|
||||||
|
flake = "/home/${username}/nixos-config";
|
||||||
|
};
|
||||||
#https://discourse.nixos.org/t/dolphin-does-not-have-mime-associations/48985/3
|
#https://discourse.nixos.org/t/dolphin-does-not-have-mime-associations/48985/3
|
||||||
# This fixes the unpopulated MIME menus
|
# This fixes the unpopulated MIME menus
|
||||||
#environment.etc."/xdg/menus/plasma-applications.menu".text = builtins.readFile "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";
|
#environment.etc."/xdg/menus/plasma-applications.menu".text = builtins.readFile "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";
|
||||||
|
|
@ -234,7 +241,7 @@
|
||||||
|
|
||||||
|
|
||||||
programs.steam = {
|
programs.steam = {
|
||||||
enable = if system == "x86_64-linux" then true else false;
|
enable = if hwconfig.system == "x86_64-linux" then true else false;
|
||||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||||
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
||||||
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
||||||
|
|
@ -261,9 +268,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
extraSpecialArgs = {inherit pkgs; inherit hostname; inherit nixvim; inherit inputs;};
|
extraSpecialArgs = {inherit pkgs; inherit hwconfig; inherit username; inherit nixvim; inherit inputs;};
|
||||||
users = {
|
users = {
|
||||||
"kylekrein" = import ./home.nix;
|
"${username}" = import ./home.nix;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
stylix = {
|
stylix = {
|
||||||
|
|
@ -323,7 +330,7 @@
|
||||||
|
|
||||||
programs.hyprland = {
|
programs.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = inputs.hyprland.packages."${system}".hyprland;
|
package = inputs.hyprland.packages."${hwconfig.system}".hyprland;
|
||||||
xwayland.enable = true;
|
xwayland.enable = true;
|
||||||
systemd.setPath.enable = true;
|
systemd.setPath.enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, pkgs, stylix, hostname, inputs, ... }:
|
{ config, pkgs, stylix, hwconfig, username, inputs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
#nur = import (builtins.fetchTarball {
|
#nur = import (builtins.fetchTarball {
|
||||||
|
|
@ -19,11 +19,10 @@
|
||||||
];
|
];
|
||||||
# Home Manager needs a bit of information about you and the paths it should
|
# Home Manager needs a bit of information about you and the paths it should
|
||||||
# manage.
|
# manage.
|
||||||
home.username = "kylekrein";
|
home.username = username;
|
||||||
home.homeDirectory = "/home/kylekrein";
|
home.homeDirectory = "/home/${username}";
|
||||||
stylix = {
|
stylix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
targets.hyprlock.enable = true;
|
|
||||||
};
|
};
|
||||||
qt = {
|
qt = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, lib, hostname, ... }:
|
{ pkgs, lib, hwconfig, username, ... }:
|
||||||
let
|
let
|
||||||
toggle_monitors = ./toggle_monitors.sh;
|
toggle_monitors = ./toggle_monitors.sh;
|
||||||
wallpaper-image = ./wallpaper.jpg;
|
wallpaper-image = ./wallpaper.jpg;
|
||||||
|
|
@ -13,7 +13,7 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
xwayland.enable = true;
|
xwayland.enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
monitor = if hostname == "nixosbtw" then [
|
monitor = if hwconfig.hostname == "${username}-homepc" then [
|
||||||
"DP-1,2560x1440@75,1600x0,1.6"
|
"DP-1,2560x1440@75,1600x0,1.6"
|
||||||
"DP-3,2560x1440@75,0x0,1.6"
|
"DP-3,2560x1440@75,0x0,1.6"
|
||||||
] else ",highres,auto,1.6";
|
] else ",highres,auto,1.6";
|
||||||
|
|
@ -23,6 +23,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
exec-once = [
|
exec-once = [
|
||||||
|
"${if hwconfig.isLaptop then "brightnessctl set 25%" else ""}"
|
||||||
"dbus-update-activation-environment --systemd --all"
|
"dbus-update-activation-environment --systemd --all"
|
||||||
"${pkgs.waybar}/bin/waybar &"
|
"${pkgs.waybar}/bin/waybar &"
|
||||||
"${pkgs.networkmanagerapplet}/bin/nm-applet &"
|
"${pkgs.networkmanagerapplet}/bin/nm-applet &"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, lib, hostname, ... }:
|
{ pkgs, lib, hwconfig, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
programs.waybar = {
|
programs.waybar = {
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
#"memory"
|
#"memory"
|
||||||
#"temperature"
|
#"temperature"
|
||||||
"hyprland/language"
|
"hyprland/language"
|
||||||
] ++ (if hostname != "nixosbtw" then [ "battery" ] else [ ])
|
] ++ (if hwconfig.isLaptop then [ "battery" ] else [ ])
|
||||||
++ [
|
++ [
|
||||||
"tray"
|
"tray"
|
||||||
"custom/notification"
|
"custom/notification"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, username, ... }:
|
||||||
let
|
|
||||||
username = "kylekrein";
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
libvirtd = {
|
libvirtd = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue