Skip to content

Commit

Permalink
feat(hosts): added a new hosts profile: laptop
Browse files Browse the repository at this point in the history
  • Loading branch information
Wittano committed Jan 6, 2025
1 parent 8f3c04e commit dcd538a
Show file tree
Hide file tree
Showing 9 changed files with 431 additions and 340 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ xmonad-check:
cd ./nixos/desktop/xmonad
cabal build --enable-nix
cd $PWD

try-laptop:
nh os build -H laptop . -- --show-trace
5 changes: 4 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@
{
lib = lib.my;

nixosConfigurations.pc = lib.my.hosts.mkHost "pc";
nixosConfigurations = {
pc = lib.my.hosts.mkHost "pc";
laptop = lib.my.hosts.mkHost "laptop";
};
overlays.default = overlays.overlay;
devShells.${system}.default = unstable.callPackage ./shell.nix { };
templates = import ./templates.nix { inherit lib; };
Expand Down
10 changes: 8 additions & 2 deletions home-manager/polybar.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,21 @@ let
};
in
{
options.serivces.polybar.wittano.enable = mkEnableOption "Enable custom polybar config";
options.serivces.polybar.wittano = {
enable = mkEnableOption "Enable custom polybar config";
profile = mkOption {
type = types.enumOf [ "wittano" "laptop" ];
description = "Select polybar profile";
};
};

config = mkIf config.serivces.polybar.wittano.enable {
fonts.fontconfig.enable = true;
home.packages = with pkgs; [ font-awesome font-awesome_5 siji nerdfonts ];

services.polybar = {
enable = true;
script = "polybar wittano";
script = "polybar ${cfg.profile}";
config = {
"bar/wittano" = {
monitor = "\${env:MONITOR:HDMI-1}";
Expand Down
331 changes: 331 additions & 0 deletions hosts/common.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,331 @@
{ config
, lib
, pkgs
, inputs
, unstable
, hostname
, desktopName ? "xmonad"
, cores ? 24
, ...
}:
with lib;
with lib.my;
let
accent = "peach";
flavor = "frappe";

nixDotfilesPath = "${config.home-manager.users.wittano.home.homeDirectory}/nix-dotfiles";

systemVersion = "24.11";
homeManagerConfig = {
imports = [
inputs.catppuccin.homeManagerModules.catppuccin
inputs.nixvim.homeManagerModules.nixvim
./../home-manager
];
home.stateVersion = systemVersion;

programs = {
mpv.enable = true;
btop.enable = true;
nitrogen.wittano.enable = true;
kitty.wittano.enable = true;
fish.wittano = {
enable = true;
enableDirenv = true;
};

jetbrains.ides = [ "go" "fork" "python" "cpp" "elixir" "haskell" ];
git.wittano.enable = true;
rofi.wittano = {
inherit desktopName;

enable = true;
};

tmux.wittano.enable = true;
neovim.wittano.enable = true;

fish = {
functions.download-yt.body = "${pkgs.parallel}/bin/parallel ${pkgs.yt-dlp}/bin/yt-dlp ::: $argv";
shellAliases = {
open = "xdg-open";

# Projects
pnix = "cd $HOME/nix-dotfiles";
plab = "cd $HOME/projects/server/home-lab";

# Nix
nfu = "nix flake update";
nfc = "nix flake check";
repl = "nix repl -f '<nixpkgs>'";

# systemd
scs = "sudo systemctl status";
scst = "sudo systemctl stop";
scsta = "sudo systemctl start";
sce = "sudo systemctl enable --now";
scr = "sudo systemctl restart";
sdb = "systemd-analyze blame";
};
};
};

qt.wittano.enable = true;
gtk.wittano.enable = true;

catppuccin = {
inherit accent flavor;

enable = true;
};

services = {
redshift.wittano.enable = true;
picom.wittano.enable = true;
dunst.wittano.enable = true;
};

home.packages = with pkgs; [
# Utils
flameshot

# Folder Dialog menu
zenity

# Web browser
vivaldi

# Utils
thunderbird # Mail
eog # Image viewer
onlyoffice-bin # Office staff
nemo
sshs
pandoc # Text file converter

# Apps
spotify
logseq
keepassxc
krita
qbittorrent
# vlc
# unstable.joplin-desktop # Notebook
# unstable.vscodium # VS code
minder # Mind maps
# insomnia # REST API Client
gnome-pomodoro
# unstable.figma-linux # Figma
todoist-electron # ToDo app

# Security
bitwarden

# Social media
telegram-desktop
# unstable.freetube # Youtube desktop
signal-desktop # Signal desktop
element-desktop # matrix communicator
vesktop
irssi # IRC chat
# unstable.streamlink-twitch-gui-bin
];

desktop.autostart.enable = true;

gtk.gtk3.bookmarks = [
"file://${nixDotfilesPath} Nix configuration"
];
};

networkModule = import (./. + "/${hostname}/networking.nix") { inherit lib; };
hardwareModule = import (./. + "/${hostname}/hardware.nix") { };
in
mkMerge [
networkModule
hardwareModule
rec {

# Nix configuration
nix = {
settings = rec {
inherit cores;

max-jobs = cores;
auto-optimise-store = true;
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
package = pkgs.nix;
extraOptions = "experimental-features = nix-command flakes";
};

nixpkgs.config = {
allowBroken = false;
allowUnfree = true;
};

time.timeZone = "Europe/Warsaw";

# Locale
i18n = {
defaultLocale = "en_US.UTF-8";

extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
};

console = {
font = "Lat2-Terminus16";
keyMap = services.xserver.xkb.layout;
};

# Fonts
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-extra
noto-fonts-color-emoji
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-emoji-blob-bin

hanazono
hackgen-nf-font
];

# Global packages
environment = {
systemPackages = with pkgs; [ vim htop bash keymapp wally-cli ];
variables =
{
EDITOR = "vim";
NIX_DOTFILES = nixDotfilesPath;
};

shells = with pkgs; [ bash fish ];
};

# Linux Kernel settings
boot = {
supportedFilesystems = {
ntfs = true;
nfs = true;
};
initrd.availableKernelModules = [ "ahci" "xhci_pci" "sd_mod" "sr_mod" ];

tmp.cleanOnBoot = true;

loader = {
grub.wittano = {
enable = true;
enableMultiBoot = false;
};
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi";
};
};

plymouth = {
enable = true;
themePackages = with pkgs; [ nixos-blur-playmouth ];
theme = "nixos-blur";
};
};

virtualisation.docker.wittano.enable = true;
hardware = {
trackpoint.emulateWheel = true;
printers.wittano.enable = true;
bluetooth.wittano.enable = true;
};

# Network
networking = {
hostName = "nixos";
firewall = {
allowPing = false;
rejectPackets = true;
};
};

#User settings
users.users = {
wittano = {
isNormalUser = true;
uid = mkDefault 1000;
extraGroups = [ "wheel" ];
shell = pkgs.fish;
};
};

catppuccin = {
inherit accent flavor;

enable = mkForce false;
};

programs = {
fish.enable = true;
file-roller.enable = true; # Archive explorer
evince.enable = true; # PDF viever
# droidcam.enable = true; # FIXME Problem with sharing Video phone <-> pc. ONLY ON LINUX
};

# Home-manager
home-manager = {
extraSpecialArgs = { inherit pkgs unstable lib inputs; };
useUserPackages = true;
backupFileExtension = "backup";
users.wittano = homeManagerConfig;
};

# Programs
services.locate = {
enable = true;
interval = "21:37";
};

desktop."${desktopName}" = {
enable = true;
users = [ "wittano" ];
};

# System
system.stateVersion = systemVersion;

services = {
pipewire.wittano.enable = true;
udisks2 = {
enable = true;
mountOnMedia = true;
};

devmon.enable = true;
gvfs.enable = true;
xserver = {
xkb.layout = "pl";
wacom.wittano.enable = true;
};

syncthing.wittano.enable = true;
displayManager.sddm.wittano = {
enable = true;
package = pkgs.catppuccin-sddm-corners;
};
};
}
]
24 changes: 24 additions & 0 deletions hosts/laptop/configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ config, lib, pkgs, hostname, inputs, unstable, ... }:
with lib;
with lib.my;
let
desktopName = "bspwm";
commonConfig = import ../common.nix { inherit desktopName config lib hostname pkgs unstable inputs; cores = 4; };
in
mkMerge [
commonConfig
{
virtualisation.docker.wittano.enable = true;

desktop.bspwm.deviceType = "laptop";

hardware = {
trackpoint.emulateWheel = true;
keyboard.zsa.enable = true;

nvidia.enable = true;
samba.enable = true;
printers.wittano.enable = true;
};
}
]
Loading

0 comments on commit dcd538a

Please sign in to comment.