1
Fork 0

Started working on guest@euporie

This commit is contained in:
Matei Adriel 2023-05-28 02:00:10 +02:00
parent 0503a81ee8
commit 230a739327
No known key found for this signature in database
62 changed files with 188 additions and 135 deletions

View file

@ -1,6 +1,7 @@
{
description = "Satellite";
# {{{ Inputs
inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
@ -61,9 +62,11 @@
hyprland-contrib.url = "github:hyprwm/contrib";
hyprland-contrib.inputs.nixpkgs.follows = "nixpkgs-unstable";
};
# }}}
outputs = { self, nixpkgs, home-manager, ... }@inputs:
let
# {{{ Common helpers
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux"
@ -75,17 +78,20 @@
specialArgs = system: {
inherit inputs outputs;
# This is used so often it makes sense to have it as it's own thing
upkgs = inputs.nixpkgs-unstable.legacyPackages.${system};
};
# }}}
in
{
# {{{ Packages
# Acessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./pkgs { inherit pkgs; }
);
# Devshell for bootstrapping
# }}}
# {{{ Bootstrapping and other pinned devshells
# Acessible through 'nix develop'
devShells = forAllSystems
(system:
@ -96,7 +102,8 @@
devshells = import ./devshells args;
in
devshells // { inherit default; });
# }}}
# {{{ Overlays and modules
# Custom packages and modifications, exported as overlays
overlays = import ./overlays;
@ -105,41 +112,65 @@
# Reusable home-manager modules
homeManagerModules = import ./modules/home-manager // import ./modules/common;
# }}}
# {{{ Nixos
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#...
nixosConfigurations = {
tethys = let system = "x86_64-linux"; in
nixpkgs.lib.nixosSystem {
nixosConfigurations =
let
nixos = { system, hostname }: nixpkgs.lib.nixosSystem {
specialArgs = specialArgs system;
modules = [
home-manager.nixosModules.home-manager
{
home-manager.users.adrielus = import ./home/adrielus/tethys.nix;
home-manager.users.adrielus = import ./home/tethys.nix;
home-manager.extraSpecialArgs = specialArgs system;
home-manager.useUserPackages = true;
stylix.homeManagerIntegration.followSystem = false;
stylix.homeManagerIntegration.autoImport = false;
}
./hosts/nixos/tethys
./hosts/nixos/${hostname}
];
};
};
in
{
tethys = nixos {
system = "x86_64-linux";
hostname = "tethys";
};
euporie = nixos {
system = "x86_64-linux";
hostname = "euporie";
};
};
# }}}
# {{{ Home manager
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#...
homeConfigurations = {
"adrielus@tethys" = let system = "x86_64-linux"; in
home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = specialArgs system;
modules = [
./home/adrielus/tethys.nix
];
homeConfigurations =
let
mkHomeConfig = { system, hostname }:
home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = specialArgs system;
modules = [
./home/${hostname}.nix
];
};
in
{
"adrielus@tethys" = mkHomeConfig {
system = "x86_64-linux";
hostname = "tethys";
};
};
"guest@euporie" = mkHomeConfig {
system = "x86_64-linux";
hostname = "euporie";
};
};
# }}}
};
# {{{ Caching and whatnot

20
home/euporie.nix Normal file
View file

@ -0,0 +1,20 @@
{
imports = [
./global
./features/wayland/hyprland
];
# Set up my custom imperanence wrapper
satellite.persistence = {
enable = true;
# Actual data/media (eg: projects, images, videos, etc)
at.data.path = "/persist/data";
# App state I want to keep
at.state.path = "/persist/state";
# App state which I should be able to delete at any point
at.cache.path = "/persist/cache";
};
}

12
home/features/README.md Normal file
View file

@ -0,0 +1,12 @@
# Common home manager stuff
## File structure
| Directory | Description |
| -------------------- | --------------------------------------------- |
| [cli/](./cli) | Configuration for terminal stuff |
| [desktop](./desktop) | Desktop apps usable on both wayland and xorg |
| [xorg](./xorg) | Xorg only stuff |
| [wayland](./wayland) | Wayland only stuff |
| [neovim](./neovim) | Neovim (to be expanded in the future ) |
| [games](./games) | Similar to [desktop](./desktop) but for games |

View file

Before

Width:  |  Height:  |  Size: 423 B

After

Width:  |  Height:  |  Size: 423 B

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View file

@ -1,6 +1,11 @@
# Common wayland stuff
{ lib, pkgs, upkgs, ... }: {
imports = [ ./wofi.nix ./dunst.nix ];
imports = [
./wofi.nix
./dunst.nix
../desktop/wezterm # Default hyprland terminal
];
# Makes some stuff run on wayland (?)
# Taken from [here](https://github.com/fufexan/dotfiles/blob/3b0075fa7a5d38de13c8c32140c4b020b6b32761/home/wayland/default.nix#L14)

View file

@ -1,5 +1,5 @@
{ pkgs, inputs, ... }: {
imports = [ ../common/wayland.nix ];
imports = [ ../default.nix ];
home.packages = [ inputs.hyprland-contrib.packages.${pkgs.system}.grimblast ];

View file

@ -1,16 +1,15 @@
{ pkgs, ... }: {
imports = [
./common/rofi
./common/polybar
./common/eww
./common/feh.nix
../desktop/eww
./rofi
./polybar
./feh.nix
];
# Other packages I want to install:
home.packages = with pkgs; [
xclip # Clipboard stuff
spectacle # Take screenshots
vimclip # Vim anywhere!
];
stylix.targets.xresources.enable = true;
}

View file

@ -1,16 +1,9 @@
{ pkgs, ... }: {
imports = [
./common/wezterm
./common/alacritty.nix
./default.nix
../desktop/alacritty.nix # Default xmonad terminal
];
# Other packages I want to install:
home.packages = with pkgs; [
vimclip # Vim anywhere!
];
stylix.targets.gtk.enable = true;
# Command required to get the xdg stuff to work. Suggested by @lily on discord.
xsession.initExtra = "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd --all";
}

View file

@ -1,6 +1,6 @@
{ inputs, lib, pkgs, config, outputs, ... }:
let
# Extra modules to import
# {{{ Imports
imports = [
inputs.stylix.homeManagerModules.stylix
inputs.homeage.homeManagerModules.homeage
@ -12,17 +12,19 @@ let
../features/neovim
../../../common
];
# Extra overlays to add
# }}}
# {{{ Overlays
overlays = [
# inputs.neovim-nightly-overlay.overlay
inputs.agenix.overlay
];
# }}}
in
{
# Import all modules defined in modules/home-manager
imports = builtins.attrValues outputs.homeManagerModules ++ imports;
# {{{ Nixpkgs
nixpkgs = {
# Add all overlays defined in the overlays directory
overlays = builtins.attrValues outputs.overlays ++ overlays;
@ -33,6 +35,7 @@ in
allowUnfreePredicate = (_: true);
};
};
# }}}
# Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";
@ -59,10 +62,16 @@ in
# Set the xdg env vars
xdg.enable = true;
# Create xdg user directories
# {{{ Create xdg user directories
xdg.userDirs = {
enable = lib.mkDefault true;
createDirectories = lib.mkDefault true;
extraConfig.XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
};
# }}}
# {{{ Ad-hoc stylix targets
stylix.targets.gtk.enable = true;
# TODO: is this useful outside xorg?
stylix.targets.xresources.enable = true;
# }}}
}

View file

@ -1,14 +1,15 @@
{ inputs, outputs, lib, config, pkgs, ... }: {
{ pkgs, ... }: {
imports = [
./global
./features/desktop/common/discord.nix
./features/desktop/common/signal.nix
./features/desktop/common/qbittorrent.nix
./features/desktop/common/zathura.nix
./features/desktop/common/firefox
./features/desktop/xmonad.nix
./features/desktop/hyprland
./features/desktop
./features/desktop/discord.nix
./features/desktop/signal.nix
./features/desktop/qbittorrent.nix
./features/desktop/zathura.nix
./features/desktop/firefox
./features/xorg/xmonad.nix
./features/wayland/hyprland
./features/games
];

View file

@ -44,11 +44,19 @@ in
# Add each host in this repo to the knownHosts list
programs.ssh = {
knownHosts = builtins.mapAttrs
(name: _: {
publicKeyFile = pubKey name;
extraHostNames = lib.optional (name == hostname) "localhost";
})
hosts;
knownHosts = lib.pipe hosts [
# attrsetof host -> attrsetof { ... }
(builtins.mapAttrs
# string -> host -> { ... }
(name: _: {
publicKeyFile = pubKey name;
extraHostNames = lib.optional (name == hostname) "localhost";
}))
# attrsetof { ... } -> attrsetof { ... }
(lib.attrset.filterAttrs
# string -> { ... } -> bool
(_: { publicKeyFile, ... }: builtins.pathExists publicKeyFile))
];
};
}

View file

@ -1,6 +1,7 @@
{
{ pkgs, ... }: {
security.rtkit.enable = true;
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
@ -10,14 +11,17 @@
};
# Volume controls
environment.shellAliases = {
# Relative
"v-up" = "pactl set-sink-volume @DEFAULT_SINK@ +5%";
"v-down" = "pactl set-sink-volume @DEFAULT_SINK@ +5%";
environment.shellAliases =
let pactl = "${pkgs.pulseaudio}/bin/pactl";
in
{
# Relative
"v-up" = "${pactl} set-sink-volume @DEFAULT_SINK@ +5%";
"v-down" = "${pactl} set-sink-volume @DEFAULT_SINK@ +5%";
# Absolute
"v-min" = "pactl set-sink-volume @DEFAULT_SINK@ 0%";
"v-mid" = "pactl set-sink-volume @DEFAULT_SINK@ 50%";
"v-max" = "pactl set-sink-volume @DEFAULT_SINK@ 100%";
};
# Absolute
"v-min" = "${pactl} set-sink-volume @DEFAULT_SINK@ 0%";
"v-mid" = "${pactl} set-sink-volume @DEFAULT_SINK@ 50%";
"v-max" = "${pactl} set-sink-volume @DEFAULT_SINK@ 100%";
};
}

View file

@ -1,4 +1,4 @@
{ pkgs, outputs, config, ... }:
{ pkgs, outputs, config, lib, ... }:
let
# Record containing all the hosts
hosts = outputs.nixosConfigurations;
@ -16,37 +16,36 @@ in
# Create an user named adrielus
users.adrielus = {
# Make fish the default shell
shell = pkgs.fish;
# Adds me to some default groups, and creates the home dir
isNormalUser = true;
# File containing my password, managed by agenix
passwordFile = config.age.secrets.adrielusPassword.path;
# Set default shell
shell = pkgs.fish;
# Add user to the following groups
extraGroups = [
"wheel" # access to sudo
"network" # for wireless stuff
"networkmanager" # I assume this let's me access network stuff?
"lp" # Allows me to use printers
"docker" # Allows me to use docker (?)
"audio" # Allows me to use audio devices
"video" # Allows me to use a webcam
"uinput" # I think this let's me write to virtual devices
"input" # Does this let me use evdev (?)
# TODO: find out why I added these here a long time ago
"sound"
"tty"
"wheel" # Access to sudo
"lp" # Printers
"audio" # Audio devices
"video" # Webcam and the like
"network" # for wireless stuff (???)
];
# Adds me to some default groups, and creates the home dir
isNormalUser = true;
openssh.authorizedKeys.keyFiles =
builtins.attrValues # attrsetof path -> path[]
(builtins.mapAttrs # ... -> attrsetof host -> attrsetof path
(name: _: idKey name) # string -> host -> path
hosts);
lib.pipe hosts [
# attrsetof host -> attrsetof path
(builtins.mapAttrs
(name: _: idKey name)) # string -> host -> path
# attrsetof path -> path[]
builtins.attrValues
# path[] -> path[]
(builtins.filter builtins.pathExists)
];
};
};
}

View file

@ -1,34 +0,0 @@
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [
../common/global
../common/users/adrielus.nix
../common/optional/pipewire.nix
../common/optional/touchpad.nix
../common/optional/xserver.nix
../common/optional/lightdm.nix
../common/optional/steam.nix
../common/optional/slambda.nix
../common/optional/xdg-portal.nix
../common/optional/hyprland.nix
../common/optional/xmonad
./hardware-configuration.nix
./boot.nix
];
# Set the name of this machine!
networking.hostName = "tethys";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "22.11";
# {{{ A few ad-hoc hardware settings
hardware.opengl.enable = true;
hardware.opentabletdrivers.enable = true;
# }}}
# {{{ A few ad-hoc programs
programs.kdeconnect.enable = true;
programs.extra-container.enable = true;
# }}}
}

View file

@ -0,0 +1,17 @@
{
imports = [
../common/global
../common/optional/pipewire.nix
../common/optional/touchpad.nix
../common/optional/lightdm.nix
../common/optional/xdg-portal.nix
../common/optional/hyprland.nix
];
# Set the name of this machine!
networking.hostName = "euporie";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "22.11";
}

View file

@ -1,4 +1,4 @@
{ inputs, outputs, lib, config, pkgs, ... }: {
{
imports = [
../common/global
../common/users/adrielus.nix

View file

@ -1,7 +0,0 @@
#!/run/current-system/sw/bin/bash
if [ $# -eq 0 ]
then
~/.local/share/hm-result/activate
else
~/.local/share/hm-result/specialization/$1/activate
fi

View file

@ -1,4 +0,0 @@
#!/run/current-system/sw/bin/bash
home-manager build --flake .#$1
rm -rf ~/.local/share/hm-result/$1
mv result ~/.local/share/hm-result/$1