something

This commit is contained in:
Tasia Iso 2024-04-17 22:28:27 +02:00
parent b48972e264
commit 00eefb0cbc
18 changed files with 161 additions and 149 deletions

View file

@ -1,7 +1,46 @@
# My NixOS config
## File system structure
- `common`: stores all Nix files which are shared by all system configs
- `de`: Desktop environments and their parameters
- `hardware`: self-explenatory
- `locales`: localization options
- `packages`: services & packages with common configurations
- `default.nix`: The minimum configuration that a machine needs
- `full-install.nix`: if this machine has a DE or is going to be used by a human
- `tasia-packages.nix`: Collection of additional packages
- `hosts`: Machine-specific configurations
- `modules/nixos`: Custom NixOS modules
- `overlays`: Custom NixOS overlays
- `pkgs`: Custom NixOS packages
## Memo
Update channels: `nix flake update`
Build a configuration: `# nixos-rebuild switch --flake .#phoenix`
Build enry and upload a generation: TODO
# Hosts
## pc
My main PC. Mostly unused because of power constraints
## phoenix ## phoenix
phoenix ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJTqExIIZuW9yvK7mgveNK8KDGKaRswrjj/nwVDwUdeL `phoenix ssh-ed25519 AAAAC3Nza C1lZDI1NTE5AAAAIJTqExIIZuW9yvK7mgveNK8KDGKaRswrjj/nwVDwUdeL`
## enry My old laptop.
enry ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHCPPE7U87PZ4+BQrdJtPuD/ibf9ubyPAqcRJe6Lpc2D ## stuff
Another person's laptop.
### enry
`enry ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHCPPE7U87PZ4+BQrdJtPuD/ibf9ubyPAqcRJe6Lpc2D`
This is my Raspberry Pi 3B+ inside my electrical cabinet.

View file

@ -1,4 +1,4 @@
{ pkgs,... }: { {pkgs, ...}: {
# Allows non-free packages to be installed # Allows non-free packages to be installed
nixpkgs = { nixpkgs = {
config = { config = {

View file

@ -1,4 +1,4 @@
{ pkgs, ...}: { {pkgs, ...}: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# See ./plasma6.nix # See ./plasma6.nix
ksshaskpass ksshaskpass

View file

@ -1,5 +1,5 @@
{ pkgs, ...}: { {pkgs, ...}: {
imports = [ imports = [
./plasma-packages.nix ./plasma-packages.nix
]; ];
@ -13,7 +13,7 @@
# Use ksshaskpass to access stored secrets # Use ksshaskpass to access stored secrets
environment.sessionVariables = rec { environment.sessionVariables = rec {
GIT_ASKPASS=ksshaskpass GIT_ASKPASS = "ksshaskpass";
}; };
programs.kdeconnect = { programs.kdeconnect = {

View file

@ -1,5 +1,5 @@
{ pkgs, ...}: { {pkgs, ...}: {
imports = [ imports = [
./plasma-packages.nix ./plasma-packages.nix
]; ];

View file

@ -8,6 +8,7 @@
}: { }: {
imports = [ imports = [
./packages/neovim.nix ./packages/neovim.nix
./packages/zsh.nix
]; ];
nixpkgs = { nixpkgs = {

View file

@ -1,7 +1,4 @@
{ {pkgs, ...}: {
pkgs,
...
}: {
# Enable CUPS to print documents. # Enable CUPS to print documents.
services.printing.enable = true; services.printing.enable = true;
@ -16,27 +13,6 @@
pulse.enable = true; pulse.enable = true;
}; };
# Z Shell
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
ll = "ls -al";
};
ohMyZsh = {
enable = true;
plugins = [
"git"
];
theme = "robbyrussell";
};
};
users.defaultUserShell = pkgs.zsh;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# #
]; ];

View file

@ -1,4 +1,4 @@
{pkgs, ...}: { {lib, ...}: {
# Disable systemd-boot # Disable systemd-boot
boot.loader = { boot.loader = {
systemd-boot = { systemd-boot = {

3
common/hardware/ssd.nix Normal file
View file

@ -0,0 +1,3 @@
{
services.fstrim.enable = true;
}

21
common/packages/zsh.nix Normal file
View file

@ -0,0 +1,21 @@
{pkgs, ...}: {
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
ll = "ls -al";
};
ohMyZsh = {
enable = true;
plugins = [
"git"
];
theme = "robbyrussell";
};
};
users.defaultUserShell = pkgs.zsh;
}

59
common/tasia-packages.nix Normal file
View file

@ -0,0 +1,59 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
bitwarden
nextdns
# android-tools
gocryptfs
#endless-sky
#gnucash
# obs-studio
# kdenlive
rustc
cargo
nodejs
rpi-imager
# wireshark
# appimage-run
#ssb-patchwork
simplex-chat-desktop
#android-studio
#swig
picard
kleopatra
qbittorrent
tor-browser
protonvpn-gui
# radicle-cli
# opensnitch-ui
yarn
nodePackages.node-gyp
nodePackages.node-pre-gyp
# superTuxKart
openssl
# qgis
helix
holehe
smartmontools
cheat
lazygit
ripgrep
jq
yq
neofetch
tldr
bat
dust
powertop
fzf
atuin
zellij
eza
lapce
gotty
gping
yazi
tildefriends
];
}

View file

@ -2,20 +2,10 @@
description = "My NixOS config"; description = "My NixOS config";
inputs = { inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
stable.url = "github:nixos/nixpkgs/nixos-23.11"; stable.url = "github:nixos/nixpkgs/nixos-23.11";
# You can access packages and modules from different nixpkgs revs
# at the same time. Here's an working example:
unstable.url = "github:nixos/nixpkgs/nixos-unstable"; unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'.
# TODO: Add any other flake you might need
# hardware.url = "github:nixos/nixos-hardware";
# Shameless plug: looking for a way to nixify your themes and make
# everything match nicely? Try nix-colors!
# nix-colors.url = "github:misterio77/nix-colors";
}; };
outputs = { outputs = {
@ -26,24 +16,29 @@
... ...
} @ inputs: let } @ inputs: let
inherit (self) outputs; inherit (self) outputs;
# Supported systems for your flake packages, shell, etc. # Supported systems for your flake packages, shell, etc.
systems = [ systems = [
"aarch64-linux" "aarch64-linux"
"x86_64-linux" "x86_64-linux"
]; ];
# This is a function that generates an attribute by calling a function you # This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument # pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs systems; forAllSystems = nixpkgs.lib.genAttrs systems;
in { in {
# Your custom packages # Your custom packages
# Accessible through 'nix build', 'nix shell', etc # Accessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
# Formatter for your nix files, available through 'nix fmt' # Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt' # Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# Your custom packages and modifications, exported as overlays # Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;}; overlays = import ./overlays {inherit inputs;};
# Reusable nixos modules you might want to export # Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs # These are usually stuff you would upstream into nixpkgs
nixosModules = import ./modules/nixos; nixosModules = import ./modules/nixos;

View file

@ -1,17 +0,0 @@
# Hosts
## enry
This is my Raspberry Pi 3B+ inside my electrical cabinet.
## pc
My main PC.
## phoenix
My old laptop.
## stuff
A friend's laptop.

View file

@ -12,6 +12,7 @@
../../common/locales/fr-keymap.nix ../../common/locales/fr-keymap.nix
../../common/hardware/intelcpu.nix ../../common/hardware/intelcpu.nix
# ../../common/hardware/amdgpu.nix # ../../common/hardware/amdgpu.nix
../../common/hardware/ssd.nix
../../common/packages/syncthing.nix ../../common/packages/syncthing.nix
../../common/packages/adguardhome.nix ../../common/packages/adguardhome.nix
@ -64,6 +65,10 @@
# Needed to build enry # Needed to build enry
boot.binfmt.emulatedSystems = ["aarch64-linux"]; boot.binfmt.emulatedSystems = ["aarch64-linux"];
environment.systemPackages = with pkgs; [
#
];
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "23.05"; system.stateVersion = "23.05";
} }

View file

@ -13,19 +13,14 @@
../../common/locales/en-keymap.nix ../../common/locales/en-keymap.nix
../../common/hardware/intelcpu.nix ../../common/hardware/intelcpu.nix
../../common/hardware/nvidiagpu.nix ../../common/hardware/nvidiagpu.nix
../../common/hardware/ssd.nix
../../common/de/plasma6.nix ../../common/de/plasma6.nix
../../common/de/hyprland.nix ../../common/de/hyprland.nix
../../common/packages/syncthing.nix ../../common/packages/syncthing.nix
../../common/packages/adguardhome.nix ../../common/packages/adguardhome.nix
../../common/tasia-packages.nix
# If you want to use modules your own flake exports (from modules/nixos):
# outputs.nixosModules.example
# Or modules from other flakes (such as nixos-hardware):
# inputs.hardware.nixosModules.common-cpu-amd
# inputs.hardware.nixosModules.common-ssd
]; ];
boot = { boot = {
@ -78,13 +73,7 @@
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
bitwarden #
nextdns
obs-studio
kdenlive
rpi-imager
kleopatra
xonotic
]; ];
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion

View file

@ -13,21 +13,16 @@
../../common/locales/fr-keymap.nix ../../common/locales/fr-keymap.nix
../../common/hardware/intelcpu.nix ../../common/hardware/intelcpu.nix
../../common/hardware/amdgpu.nix ../../common/hardware/amdgpu.nix
../../common/hardware/ssd.nix
../../common/de/plasma6.nix ../../common/de/plasma6.nix
../../common/de/hyprland.nix ../../common/de/hyprland.nix
../../common/packages/syncthing.nix ../../common/packages/syncthing.nix
../../common/packages/adguardhome.nix ../../common/packages/adguardhome.nix
../../common/tasia-packages.nix
# If you want to use modules your own flake exports (from modules/nixos):
# outputs.nixosModules.example
../../modules/nixos/vedirect-reader.nix ../../modules/nixos/vedirect-reader.nix
# Or modules from other flakes (such as nixos-hardware):
# inputs.hardware.nixosModules.common-cpu-amd
# inputs.hardware.nixosModules.common-ssd
]; ];
boot = { boot = {
@ -92,64 +87,10 @@
}; };
# Needed to build enry # Needed to build enry
boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; boot.binfmt.emulatedSystems = ["aarch64-linux"];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
bitwarden #
nextdns
# android-tools
gocryptfs
#endless-sky
#gnucash
# obs-studio
# kdenlive
rustc
cargo
nodejs
rpi-imager
# wireshark
# appimage-run
#ssb-patchwork
simplex-chat-desktop
#android-studio
#swig
picard
kleopatra
qbittorrent
tor-browser
protonvpn-gui
# radicle-cli
# opensnitch-ui
yarn
nodePackages.node-gyp
nodePackages.node-pre-gyp
# superTuxKart
openssl
# qgis
helix
holehe
smartmontools
cheat
lazygit
ripgrep
jq
yq
neofetch
tldr
bat
dust
powertop
fzf
atuin
zellij
eza
lapce
gotty
gping
yazi
tildefriends
]; ];
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion