Significant progress

This commit is contained in:
Jan Bulthuis 2024-07-18 13:48:49 +02:00
parent f80047be52
commit 5f66c1c631
28 changed files with 264 additions and 102 deletions

View File

@ -1,33 +0,0 @@
{ config, lib, pkgs, ... }:
{
imports = [
# TODO: Temporary until it has been subdivided into modules.
./merged.nix
# Modules
./modules/default.nix
# System configuration options
./system.nix
# Import test configuration
./test.nix
];
config = {
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Enable default modules
modules = {
# Greeter
tuigreet.enable = true;
};
# Localization settings
time.timeZone = "Europe/Amsterdam";
i18n.defaultLocale = "en_US.UTF-8";
console.keyMap = "us";
};
}

31
machines/laptop.nix Normal file
View File

@ -0,0 +1,31 @@
{ ... }:
{
imports = [
# Import modules
../modules/default.nix
# TODO: Remove later
../merged.nix
];
config = {
# State version
system.stateVersion = "24.05";
# Machine hostname
networking.hostName = "20212060";
# Enabled modules
modules = {
pipewire.enable = true;
wpa_supplicant.enable = true;
};
# User accounts
machine.users.jan = {
sudo = true;
configuration = ../users/jan.nix;
};
};
}

View File

@ -5,9 +5,9 @@
{ config, lib, pkgs, ... }:
let
nixvim = import (builtins.fetchGit {
url = "https://github.com/nix-community/nixvim";
});
# nixvim = import (builtins.fetchGit {
# url = "https://github.com/nix-community/nixvim";
# });
# stylix = import (pkgs.fetchFromGitHub {
# owner = "danth";
# repo = "stylix";
@ -131,10 +131,12 @@ in {
# };
# Set up networking
networking.wireless.userControlled.enable = true;
networking.hostName = "20212060"; # Define your hostname.
networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.wireless.allowAuxiliaryImperativeNetworks = true;
# networking.wireless.userControlled.enable = true;
# networking.hostName = "20212060"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# networking.wireless.allowAuxiliaryImperativeNetworks = true;
nixpkgs.config.allowUnfree = true;
# Set up graphics
hardware.graphics.enable32Bit = true;
@ -158,10 +160,10 @@ in {
};
# Set up tailscale
services.tailscale = {
enable = true;
useRoutingFeatures = "client";
};
# services.tailscale = {
# enable = true;
# useRoutingFeatures = "client";
# };
# Set time zone.
# time.timeZone = "Europe/Amsterdam";
@ -173,11 +175,11 @@ in {
# nixpkgs.config.allowUnfree = true;
# Enable sound
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
};
# services.pipewire = {
# enable = true;
# alsa.enable = true;
# pulse.enable = true;
# };
# Set up input
services.libinput.enable = true;
@ -197,7 +199,7 @@ in {
# security.pam.services.waylock = {};
# Enable programs
programs.river.enable = true;
# programs.river.enable = true;
xdg.portal = {
enable = true;
@ -209,7 +211,7 @@ in {
};
# Gamer moment
programs.steam.enable = true;
# programs.steam.enable = true;
# Define a user account. Don't forget to set a password with passwd.
# users.users.jan = {
@ -220,10 +222,7 @@ in {
# home-manager.backupFileExtension = "bak";
# Global neovim
programs.neovim = {
enable = true;
defaultEditor = true;
};
# pr`
# dconf
programs.dconf.enable = true;

View File

@ -1,9 +1,23 @@
{ lib, config, pkgs, ... }:
{
with lib; {
imports = [
./greetd/default.nix
./tuigreet/default.nix
# Import modules
./greeter/greetd/default.nix
./greeter/greetd/tuigreet.nix
./locale/default.nix
./neovim/default.nix
./sound/pipewire.nix
./users/default.nix
./unfree/default.nix
./vpn/tailscale.nix
./wifi/wpa_supplicant.nix
];
config.modules = {
# Enable default modules
neovim.enable = mkDefault true;
tuigreet.enable = mkDefault true;
tailscale.enable = mkDefault true;
};
}

View File

@ -0,0 +1,9 @@
{ lib, config, pkgs, ... }:
{
config = {
time.timeZone = "Europe/Amsterdam";
i18n.defaultLocale = "en_US.UTF-8";
console.keyMap = "us";
};
}

View File

@ -0,0 +1,17 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.neovim;
in {
options.modules.neovim = {
enable = mkEnableOption "neovim";
};
config = mkIf cfg.enable {
programs.neovim = {
enable = true;
defaultEditor = true;
};
};
}

View File

@ -0,0 +1,18 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.pipewire;
in {
options.modules.pipewire = {
enable = mkEnableOption "pipewire";
};
config = mkIf cfg.enable {
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
};
};
}

View File

@ -0,0 +1,18 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.unfree;
in {
options.modules.unfree = {
enable = mkEnableOption "unfree";
allowedPackages = mkOption {
type = types.listOf types.str;
default = [];
};
};
config = mkIf cfg.enable {
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (getName pkg) cfg.allowedPackages;
};
}

View File

@ -42,7 +42,7 @@ in {
<home-manager/nixos>
# Import system wide configuration required for user modules
./systemwide/waylock.nix
./modules/systemwide/default.nix
];
options = {

View File

@ -1,19 +1,22 @@
{ input, pkgs, config, ... }:
{
# Set the state version
home.stateVersion = "24.05";
{
imports = [
# Import all modules
./desktop/default.nix
./discord/default.nix
./feishin/default.nix
./firefox/default.nix
./obsidian/default.nix
./shell/bash.nix
./shell/fish.nix
./steam/default.nix
./theming/default.nix
./vscode/default.nix
./winbox/default.nix
./zathura/default.nix
# Import unfree helper
../../unfree/default.nix
];
}

View File

@ -0,0 +1,18 @@
{config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.discord;
in {
options.modules.discord = {
enable = mkEnableOption "discord";
};
config = mkIf cfg.enable {
modules.unfree.allowedPackages = [ "discord" ];
home.packages = with pkgs; [
discord
];
};
}

View File

@ -1,11 +1,14 @@
{config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.obsidian;
in {
options.modules.obsidian.enable = lib.mkEnableOption "obsidian";
options.modules.obsidian = {
enable = mkEnableOption "obsidian";
};
config = lib.mkIf cfg.enable {
config = mkIf cfg.enable {
home.packages = with pkgs; [
obsidian
];

View File

@ -0,0 +1,7 @@
{config, lib, pkgs, ... }:
with lib; {
options.modules.steam = {
enable = mkEnableOption "steam";
};
}

View File

@ -0,0 +1,10 @@
{ ... }:
{
imports = [
# Import systemwide configuration files.
./river.nix
./steam.nix
./waylock.nix
];
}

View File

@ -0,0 +1,10 @@
{ lib, config, pkgs, ... }:
with lib;
let
enabled = any (user: user.modules.river.enable) (attrValues config.home-manager.users);
in {
config = mkIf enabled {
programs.river.enable = true;
};
}

View File

@ -0,0 +1,10 @@
{ lib, config, pkgs, ... }:
with lib;
let
enabled = any (user: user.modules.steam.enable) (attrValues config.home-manager.users);
in {
config = mkIf enabled {
programs.steam.enable = true;
};
}

View File

@ -6,6 +6,8 @@ in {
options.modules.vscode.enable = lib.mkEnableOption "vscode";
config = lib.mkIf cfg.enable {
modules.unfree.allowedPackages = [ "vscode" ];
home.packages = with pkgs; [
vscode
];

View File

@ -0,0 +1,18 @@
{config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.winbox;
in {
options.modules.winbox = {
enable = mkEnableOption "winbox";
};
config = mkIf cfg.enable {
modules.unfree.allowedPackages = [ "winbox" ];
home.packages = with pkgs; [
winbox
];
};
}

17
modules/vpn/tailscale.nix Normal file
View File

@ -0,0 +1,17 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.tailscale;
in {
options.modules.tailscale = {
enable = mkEnableOption "tailscale";
};
config = mkIf cfg.enable {
services.tailscale = {
enable = true;
useRoutingFeatures = "client";
};
};
}

View File

@ -0,0 +1,18 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.wpa_supplicant;
in {
options.modules.wpa_supplicant = {
enable = mkEnableOption "wpa_supplicant";
};
config = mkIf cfg.enable {
networking.wireless = {
enable = true;
userControlled.enable = true;
allowAuxiliaryImperativeNetworks = true;
};
};
}

View File

@ -1,12 +0,0 @@
{ config, lib, pkgs, ... }:
{
options = {
machine.laptop = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether the current system is a laptop.";
};
};
}

View File

@ -1,17 +0,0 @@
{ config, lib, pkgs, ... }:
{
config = {
system.stateVersion = "24.05";
machine.users.jan = {
sudo = true;
configuration = ./users/jan.nix;
};
machine.users.second = {
sudo = false;
configuration = ./users/jan.nix;
};
};
}

View File

@ -11,9 +11,6 @@
# State version
home.stateVersion = "24.05";
# Allow unfree software such as vscode
nixpkgs.config.allowUnfree = true;
modules = {
# Window manager
river.enable = true;
@ -25,6 +22,11 @@
vscode.enable = true;
zathura.enable = true;
fish.enable = true;
winbox.enable = true;
discord.enable = true;
# Enable unfree
unfree.enable = true;
};
theming.themes.gruvbox = {

View File

@ -18,11 +18,11 @@ in {
# Packages
home.packages = with pkgs; [
# Programs
vscode
feishin
discord
obsidian
winbox
# vscode
# feishin
# discord
# obsidian
# winbox
# Utilities
pulsemixer