mirror of
https://github.com/Jokiller230/puzzlevision.git
synced 2025-09-09 04:10:05 +00:00
🚧 Work on fixing booting issues and various other things
This commit is contained in:
parent
dc87b2c186
commit
cd32ad1c61
9 changed files with 95 additions and 52 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -4,3 +4,9 @@
|
|||
|
||||
### Jetbrains
|
||||
/.idea
|
||||
|
||||
### Zed Editor
|
||||
/.zed
|
||||
|
||||
### VSCode
|
||||
/.vscode
|
||||
|
|
24
flake.lock
generated
24
flake.lock
generated
|
@ -2,11 +2,11 @@
|
|||
"nodes": {
|
||||
"easy-hosts": {
|
||||
"locked": {
|
||||
"lastModified": 1739315072,
|
||||
"narHash": "sha256-m0Lzdrj95GbdmKhqlTKkr4vvHy2Ghdi1GxISOKqUeSA=",
|
||||
"lastModified": 1743693165,
|
||||
"narHash": "sha256-BAYno/4P0hq3aaqfVLbDmv8pgvzJWcN+4L8jK8SzaMo=",
|
||||
"owner": "tgirlcloud",
|
||||
"repo": "easy-hosts",
|
||||
"rev": "e96af44cae1f48a1a94f2471faee92caf22aa45f",
|
||||
"rev": "611cc21942feb55c6a38410dfe8eee3fb5f08c8d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -22,11 +22,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1741352980,
|
||||
"narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=",
|
||||
"lastModified": 1743550720,
|
||||
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9",
|
||||
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -42,11 +42,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1742305478,
|
||||
"narHash": "sha256-iYCinzZnnUeCkZ031qGRwPdwRsqW6o9Y0MgGpA7Zva4=",
|
||||
"lastModified": 1745494811,
|
||||
"narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "fb74bb76d94a6c55632376c931fc108131260ee9",
|
||||
"rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -57,11 +57,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1742069588,
|
||||
"narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=",
|
||||
"lastModified": 1745391562,
|
||||
"narHash": "sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5",
|
||||
"rev": "8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
{ ... }: {
|
||||
home.stateVersion = "25.05";
|
||||
}
|
11
homes/x86_64-linux/jo/default.nix
Normal file
11
homes/x86_64-linux/jo/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
vscodium
|
||||
cmatrix
|
||||
];
|
||||
|
||||
home.stateVersion = "25.05";
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
{ self, ... }:
|
||||
{
|
||||
flake = {
|
||||
nixosModules.puzzlevision = self.lib.mkModule {
|
||||
class = "nixos";
|
||||
modules = self.lib.dirToModuleList ../nixos;
|
||||
};
|
||||
#nixosModules.puzzlevision = self.lib.mkModule {
|
||||
# class = "nixos";
|
||||
# modules = self.lib.dirToModuleList ../nixos;
|
||||
#};
|
||||
|
||||
homeModules.puzzlevision = self.lib.mkModule {
|
||||
class = "home";
|
||||
|
|
34
modules/nixos/common/grub/default.nix
Normal file
34
modules/nixos/common/grub/default.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
lib,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.common.grub;
|
||||
in {
|
||||
options.${namespace}.common.grub = { enable = mkEnableOption "grub"; };
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot.loader.systemd-boot.enable = false;
|
||||
|
||||
boot.loader.grub = {
|
||||
enable = true;
|
||||
devices = [ "nodev" ];
|
||||
efiInstallAsRemovable = true;
|
||||
efiSupport = true;
|
||||
|
||||
extraEntries = ''
|
||||
menuentry "Reboot" {
|
||||
reboot
|
||||
}
|
||||
menuentry "Poweroff" {
|
||||
halt
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
lib,
|
||||
config,
|
||||
self,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf mkOption types;
|
||||
|
@ -10,17 +11,15 @@
|
|||
|
||||
cfg = config.${namespace}.users;
|
||||
|
||||
system = builtins.currentSystem;
|
||||
systemClass =
|
||||
if builtins.match ".*-linux" system != null then "nixos"
|
||||
else if builtins.match ".*-darwin" system != null then "darwin"
|
||||
else "nixos"; # Default fallback
|
||||
# The identifier of the current system type, e.g. "x86_64-linux" or "aarch64-darwin"
|
||||
system = pkgs.system;
|
||||
|
||||
# Type for a user configuration
|
||||
userType = types.submodule {
|
||||
options = {
|
||||
enable = mkEnableOption "Enable this user";
|
||||
enable = mkEnableOption "this user";
|
||||
initialPassword = mkOpt (types.nullOr types.str) null "Initial password for the user";
|
||||
password = mkOpt (types.nullOr types.str) null "Plaintext password for the user";
|
||||
hashedPassword = mkOpt (types.nullOr types.str) null "Hashed password for the user";
|
||||
isNormalUser = mkOpt types.bool true "Whether this user is a normal user";
|
||||
extraGroups = mkOpt (types.listOf types.str) [] "Extra groups for the user";
|
||||
|
@ -28,7 +27,7 @@
|
|||
};
|
||||
|
||||
# Function to get home configuration path for a username
|
||||
getHomeConfigPath = username: "${self.outPath}/homes/${systemClass}/${username}";
|
||||
getHomeConfigPath = username: "${self.outPath}/homes/${system}/${username}";
|
||||
|
||||
# Function to check if a home configuration exists for a username
|
||||
homeConfigExists = username:
|
||||
|
@ -38,12 +37,6 @@
|
|||
# Import all home-manager modules
|
||||
homeModules = dirToModuleList "${self.outPath}/modules/home";
|
||||
in {
|
||||
imports = [
|
||||
# Import home-manager NixOS module
|
||||
# This assumes home-manager is available as a flake input
|
||||
self.inputs.home-manager.nixosModules.home-manager
|
||||
];
|
||||
|
||||
options.${namespace}.users = mkOption {
|
||||
type = types.attrsOf userType;
|
||||
default = {};
|
||||
|
@ -51,18 +44,18 @@ in {
|
|||
};
|
||||
|
||||
config = {
|
||||
# Create the actual users
|
||||
# Ensure users are fully managed by NixOS
|
||||
users.mutableUsers = false;
|
||||
|
||||
# Create the actual system users
|
||||
users.users = lib.mapAttrs (username: userConfig:
|
||||
mkIf userConfig.enable {
|
||||
name = username;
|
||||
isNormalUser = userConfig.isNormalUser;
|
||||
inherit (userConfig) extraGroups;
|
||||
initialPassword = userConfig.initialPassword;
|
||||
hashedPassword = userConfig.hashedPassword;
|
||||
inherit (userConfig) extraGroups initialPassword hashedPassword isNormalUser password;
|
||||
}
|
||||
) cfg;
|
||||
|
||||
# Configure home-manager with auto-imported configs
|
||||
# Configure home-manager with auto-imported user configuration
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
|
@ -77,7 +70,9 @@ in {
|
|||
{ ... }: {
|
||||
imports = [
|
||||
(getHomeConfigPath username) # Import the user's specific home configuration
|
||||
] ++ homeModules; # Include all home modules from /modules/home
|
||||
]; #++ homeModules; # Include all generalized home modules
|
||||
|
||||
home.stateVersion = lib.mkDefault config.system.stateVersion;
|
||||
}
|
||||
)
|
||||
) cfg;
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./hardware.nix
|
||||
];
|
||||
|
||||
users.users.jo.isNormalUser = true;
|
||||
users.users.jo.initialPassword = "balls";
|
||||
users.users.jo.createHome = true;
|
||||
|
||||
# System configuration
|
||||
puzzlevision = {
|
||||
# TODO: improve home-manager configuration loading as development continues and make sure everything works correctly.
|
||||
users = {
|
||||
jo = {
|
||||
enable = true;
|
||||
initialPassword = "balls";
|
||||
extraGroups = [ "wheel" ];
|
||||
};
|
||||
};
|
||||
|
||||
desktop.gnome.enable = true;
|
||||
utils.vm.enable = true;
|
||||
common.grub.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
ghostty
|
||||
firefox
|
||||
vscodium
|
||||
];
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue