This commit is contained in:
jacekpoz 2023-07-06 21:07:54 +02:00
parent 2688e461a9
commit e5af40f111
7 changed files with 108 additions and 61 deletions

View file

@ -1,39 +1,25 @@
{
description = "A very basic flake";
description = "Jacekpoz's Nixos Configurations";
outputs = {
self,
nixpkgs,
...
} @ inputs: let
inherit (nixpkgs) lib; # we isolate lib from nixpkgs to be able to pass it to specific flake options, alternatively use nixpkgs.lib
in {
# instead of cluttering flake.nix, import all nixosConfigurations from their own dedicated file
nixosConfigurations = import ./hosts {inherit nixpkgs inputs lib;};
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
hyprland.url = "github:hyprwm/Hyprland";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ self, nixpkgs, hyprland, home-manager, ... }: {
nixosConfigurations.niksos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
hyprland.nixosModules.default
{
home-manager.useGlobalPkgs = true;
#home-manager.users.jacek = import ./home.nix;
programs.hyprland = {
enable = true;
xwayland = {
enable = true;
hidpi = true;
};
nvidiaPatches = false;
};
}
];
};
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
packages.x86_64-linux.default = self.packages.x86_64-linux.hello;
};
}

14
homes/default.nix Normal file
View file

@ -0,0 +1,14 @@
{
inputs,
self,
...
}: {
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {inherit inputs self;}; # let home-manager access inputs and self
users = {
jacek = import ./jacek; # if more users to be added, create a directory for each one of them with a file called default.nix in them
};
};
}

27
homes/jacek/default.nix Normal file
View file

@ -0,0 +1,27 @@
{
config,
lib,
pkgs,
...
}: {
# your home-manager configuration goes in this file
programs = {
zsh.enable = true; # enable zsh on home-manager's end
home-manager.enable = true; # let home-manager enable itself
};
home = {
username = "jacek";
homeDirectory = "/home/jacek";
packages = with pkgs; [
neofetch
tree
git
librewolf-wayland
foot
keepassxc
neovim
];
stateVersion = lib.mkDefault "23.11";
};
}

26
hosts/default.nix Normal file
View file

@ -0,0 +1,26 @@
{
lib,
inputs,
...
}: let
self = inputs.self;
home-manager = inputs.home-manager.nixosModules.home-manager;
home-configs = import ../homes;
in {
niksos = lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {inherit lib inputs self;};
modules =
[
{networking.hostName = "niksos";}
./niksos
]
++ [
# this concatenates to lists
# this list includes an alias for the home-manager module, and another for the global home-manager configuration directory
home-manager
home-configs
];
};
}

View file

@ -1,10 +1,12 @@
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
config,
pkgs,
inputs,
...
}: {
imports = [
inputs.hyprland.nixosModules.default
];
nixpkgs.config.allowUnfree = true;
@ -12,7 +14,6 @@
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
networking.hostName = "niksos";
networking.networkmanager.enable = true;
time.timeZone = "Europe/Warsaw";
@ -20,18 +21,14 @@
# Enable the X11 windowing system.
# services.xserver.enable = true;
nix.settings = {
experimental-features = [
"flakes"
"nix-command"
"recursive-nix"
"ca-derivations"
];
substituters = [ "https://hyprland.cachix.org" ];
trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
substituters = ["https://hyprland.cachix.org"];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};
# Enable sound.
# sound.enable = true;
@ -42,30 +39,22 @@
programs.zsh.enable = true;
programs.hyprland = {
enable = true;
xwayland = {
enable = true;
hidpi = true;
};
nvidiaPatches = false;
};
users.users.jacek = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
extraGroups = ["wheel" "networkmanager"];
shell = pkgs.zsh;
};
home-manager.users.jacek = { pkgs, ... }: {
home = {
packages = with pkgs; [
neofetch
tree
git
librewolf-wayland
foot
keepassxc
neovim
home-manager
];
stateVersion = "23.11";
};
programs.zsh.enable = true;
};
environment.shells = with pkgs; [ zsh ];
environment.shells = with pkgs; [zsh];
#environment.systemPackages = with pkgs; [
# neovim
@ -79,4 +68,3 @@
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}

6
hosts/niksos/default.nix Normal file
View file

@ -0,0 +1,6 @@
_: {
imports = [
./configuration.nix
./hardware-configuration.nix
];
}