Compare commits
4
Commits
e22078b34a
...
890b05d352
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
890b05d352 | ||
|
|
cfcc374a69 | ||
|
|
882c04a6bf | ||
|
|
5c609ddd42 |
No files matched your search
-18
@@ -1,90 +1,72 @@
|
|||||||
* Installing
|
* Installing
|
||||||
|
|
||||||
** Fresh system (nixos USB drive)
|
** Fresh system (nixos USB drive)
|
||||||
|
|
||||||
1. Open a nix-shell with git:
|
1. Open a nix-shell with git:
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
nix-shell -p git
|
nix-shell -p git
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
2. Clone the flake
|
2. Clone the flake
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
git clone https://git.lajuntament.space/marc/samfelag.git
|
git clone https://git.lajuntament.space/marc/samfelag.git
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
3. Partition the disk
|
3. Partition the disk
|
||||||
1. Locate the disk
|
1. Locate the disk
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
lsblk
|
lsblk
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
2. Create a GPT partition table
|
2. Create a GPT partition table
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
sudo parted /dev/nvme0n1 -- mklabel gpt
|
sudo parted /dev/nvme0n1 -- mklabel gpt
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
3. Create the root partition
|
3. Create the root partition
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
sudo parted /dev/nvme0n1 -- mkpart primary 512MB -8GB
|
sudo parted /dev/nvme0n1 -- mkpart primary 512MB -8GB
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
4. Create the swap partition
|
4. Create the swap partition
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
sudo parted /dev/nvme0n1 -- mkpart primary linux-swap -8GB 100%
|
sudo parted /dev/nvme0n1 -- mkpart primary linux-swap -8GB 100%
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
5. Create the boot partition
|
5. Create the boot partition
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
sudo parted /dev/nvme0n1 -- mkpart ESP fat32 1MB 512MB
|
sudo parted /dev/nvme0n1 -- mkpart ESP fat32 1MB 512MB
|
||||||
sudo parted /dev/nvme0n1 -- set 3 esp on
|
sudo parted /dev/nvme0n1 -- set 3 esp on
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
4. Format the partitions
|
4. Format the partitions
|
||||||
1. Root partition
|
1. Root partition
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
sudo mkfs.ext4 -L nixos /dev/nvme0n1p1
|
sudo mkfs.ext4 -L nixos /dev/nvme0n1p1
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
2. Swap partition
|
2. Swap partition
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
sudo mkswap -L swap /dev/nvme0n1p2
|
sudo mkswap -L swap /dev/nvme0n1p2
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
3. Boot partition
|
3. Boot partition
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
sudo mkfs.fat -F 32 -n BOOT /dev/nvme0n1p3
|
sudo mkfs.fat -F 32 -n BOOT /dev/nvme0n1p3
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
5. Mount the filesystems
|
5. Mount the filesystems
|
||||||
1. Root partition
|
1. Root partition
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
sudo mount /dev/disk/by-label/nixos /mnt
|
sudo mount /dev/disk/by-label/nixos /mnt
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
2. Boot partition
|
2. Boot partition
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
sudo mkdir -p /mnt/boot
|
sudo mkdir -p /mnt/boot
|
||||||
sudo mount /dev/disk/by-label/BOOT /mnt/boot
|
sudo mount /dev/disk/by-label/BOOT /mnt/boot
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
3. Swap partition (if needed)
|
3. Swap partition (if needed)
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
sudo swapon /dev/disk/by-label/swap
|
sudo swapon /dev/disk/by-label/swap
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
6. Create the host nix configuration
|
6. Create the host nix configuration
|
||||||
If the host is not present under system/hosts, create a new folder for the host.
|
If the host is not present under system/hosts, create a new folder for the host.
|
||||||
Generate the hardware configuration file, you can use nixos-generate-config as a base:
|
Generate the hardware configuration file, you can use nixos-generate-config as a base:
|
||||||
|
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
nixos-generate-config --dir <<host directory>> --no-filesystems
|
nixos-generate-config --dir <<host directory>> --no-filesystems
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
7. Install nixos!
|
7. Install nixos!
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
sudo nixos-install --impure --root /mnt --flake .#reykjavik
|
sudo nixos-install --impure --root /mnt --flake .#reykjavik
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
8. Set up the user
|
8. Set up the user
|
||||||
You'll set the root password during the installation. You can then reboot and use the installed OS. First thing you'll have to do is log in as root and set the password for your user:
|
You'll set the root password during the installation. You can then reboot and use the installed OS. First thing you'll have to do is log in as root and set the password for your user:
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
|
|||||||
+34
-41
@@ -22,6 +22,7 @@
|
|||||||
;; (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light)
|
;; (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light)
|
||||||
;; doom-variable-pitch-font (font-spec :family "sans" :size 13))
|
;; doom-variable-pitch-font (font-spec :family "sans" :size 13))
|
||||||
(setq doom-font (font-spec :family "Iosevka" :size 15))
|
(setq doom-font (font-spec :family "Iosevka" :size 15))
|
||||||
|
(setq doom-unicode-font (font-spec :family "Iosevka Nerd Font" :size 15))
|
||||||
|
|
||||||
;; There are two ways to load a theme. Both assume the theme is installed and
|
;; There are two ways to load a theme. Both assume the theme is installed and
|
||||||
;; available. You can either set `doom-theme' or manually load a theme with the
|
;; available. You can either set `doom-theme' or manually load a theme with the
|
||||||
@@ -105,47 +106,39 @@
|
|||||||
|
|
||||||
(setq org-directory "~/org/")
|
(setq org-directory "~/org/")
|
||||||
|
|
||||||
(use-package org-roam
|
; (use-package org-roam
|
||||||
:ensure t
|
; :ensure t
|
||||||
:init
|
; :init
|
||||||
(setq org-roam-v2-ack t)
|
; (setq org-roam-v2-ack t)
|
||||||
:custom
|
; :custom
|
||||||
(org-roam-directory "~/org-roam")
|
; (org-roam-directory "~/org-roam")
|
||||||
(org-roam-capture-templates
|
; (org-roam-capture-templates
|
||||||
'(("d" "default" plain "%?"
|
; '(("d" "default" plain "%?"
|
||||||
:target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
|
; :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
|
||||||
:unnarrowed t)
|
; :unnarrowed t)
|
||||||
("m" "màquina" plain (file "~/org-roam/templates/maquina.org")
|
; ("m" "màquina" plain (file "~/org-roam/templates/maquina.org")
|
||||||
:target (file "%<%Y%m%d%H%M%S>-${slug}.org")
|
; :target (file "%<%Y%m%d%H%M%S>-${slug}.org")
|
||||||
:unnarrowed t)
|
; :unnarrowed t)
|
||||||
("s" "software" plain (file "~/org-roam/templates/software.org")
|
; ("s" "software" plain (file "~/org-roam/templates/software.org")
|
||||||
:target (file "%<%Y%m%d%H%M%S>-${slug}.org")
|
; :target (file "%<%Y%m%d%H%M%S>-${slug}.org")
|
||||||
:unnarrowed t)))
|
; :unnarrowed t)))
|
||||||
:config
|
; :config
|
||||||
(org-roam-setup))
|
; (org-roam-setup))
|
||||||
|
;
|
||||||
(use-package! websocket
|
; (use-package! websocket
|
||||||
:after org-roam)
|
; :after org-roam)
|
||||||
|
;
|
||||||
(use-package! org-roam-ui
|
; (use-package! org-roam-ui
|
||||||
:after org-roam ;; or :after org
|
; :after org-roam ;; or :after org
|
||||||
;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have
|
; ;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have
|
||||||
;; a hookable mode anymore, you're advised to pick something yourself
|
; ;; a hookable mode anymore, you're advised to pick something yourself
|
||||||
;; if you don't care about startup time, use
|
; ;; if you don't care about startup time, use
|
||||||
;; :hook (after-init . org-roam-ui-mode)
|
; ;; :hook (after-init . org-roam-ui-mode)
|
||||||
:config
|
; :config
|
||||||
(setq org-roam-ui-sync-theme t
|
; (setq org-roam-ui-sync-theme t
|
||||||
org-roam-ui-follow t
|
; org-roam-ui-follow t
|
||||||
org-roam-ui-update-on-save t
|
; org-roam-ui-update-on-save t
|
||||||
org-roam-ui-open-on-start nil))
|
; org-roam-ui-open-on-start nil))
|
||||||
|
|
||||||
|
|
||||||
;; -----------------------------------------------------------------------------
|
|
||||||
;; Lilypond
|
|
||||||
;; -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
(load-library "lilypond-mode")
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.ly$" . LilyPond-mode))
|
|
||||||
|
|
||||||
;; -----------------------------------------------------------------------------
|
;; -----------------------------------------------------------------------------
|
||||||
;; Appearance - Prettify
|
;; Appearance - Prettify
|
||||||
|
|||||||
+1
-2
@@ -31,7 +31,7 @@
|
|||||||
doom-dashboard ; a nifty splash screen for Emacs
|
doom-dashboard ; a nifty splash screen for Emacs
|
||||||
;; doom-quit ; DOOM quit-message prompts when you quit Emacs
|
;; doom-quit ; DOOM quit-message prompts when you quit Emacs
|
||||||
;;(emoji +unicode) ; 🙂
|
;;(emoji +unicode) ; 🙂
|
||||||
fill-column ; a `fill-column' indicator
|
;; fill-column ; a `fill-column' indicator
|
||||||
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
|
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
|
||||||
;;hydra
|
;;hydra
|
||||||
;;indent-guides ; highlighted indent columns
|
;;indent-guides ; highlighted indent columns
|
||||||
@@ -149,7 +149,6 @@
|
|||||||
;;ocaml ; an objective camel
|
;;ocaml ; an objective camel
|
||||||
(org
|
(org
|
||||||
+journal
|
+journal
|
||||||
+roam2
|
|
||||||
+pretty) ; organize your plain life in plain text
|
+pretty) ; organize your plain life in plain text
|
||||||
php ; perl's insecure younger brother
|
php ; perl's insecure younger brother
|
||||||
;;plantuml ; diagrams for confusing people more
|
;;plantuml ; diagrams for confusing people more
|
||||||
|
|||||||
@@ -60,6 +60,6 @@
|
|||||||
;; Org
|
;; Org
|
||||||
|
|
||||||
;; Org-Roam UI
|
;; Org-Roam UI
|
||||||
(unpin! org-roam)
|
; (unpin! org-roam)
|
||||||
(package! websocket)
|
; (package! websocket)
|
||||||
(package! org-roam-ui :recipe (:host github :repo "org-roam/org-roam-ui" :files ("*.el" "out")))
|
; (package! org-roam-ui :recipe (:host github :repo "org-roam/org-roam-ui" :files ("*.el" "out")))
|
||||||
Generated
-17
@@ -1,21 +1,5 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"doom-emacs": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1667229496,
|
|
||||||
"narHash": "sha256-SURAFrtblyvkflQz1cEQogfo31UzSvKd+UOgczUyJ8k=",
|
|
||||||
"owner": "doomemacs",
|
|
||||||
"repo": "doomemacs",
|
|
||||||
"rev": "9d4d5b756a8598c4b5c842e9f1f33148af2af8fd",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "doomemacs",
|
|
||||||
"repo": "doomemacs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"emacs-overlay": {
|
"emacs-overlay": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
@@ -103,7 +87,6 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"doom-emacs": "doom-emacs",
|
|
||||||
"emacs-overlay": "emacs-overlay",
|
"emacs-overlay": "emacs-overlay",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
|||||||
@@ -20,57 +20,44 @@
|
|||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
overlays = import ./overlays;
|
overlays = import ./overlays;
|
||||||
};
|
};
|
||||||
lib = nixpkgs.lib;
|
lib = nixpkgs.lib.extend
|
||||||
|
(self: super: { my = import ./lib { inherit pkgs inputs; lib = self; }; });
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
|
|
||||||
# - Kopavogur ----------------------------
|
|
||||||
kopavogur = lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
inherit pkgs;
|
|
||||||
modules = [
|
|
||||||
|
|
||||||
./system/modules
|
|
||||||
./system/profiles
|
|
||||||
./system/hosts/kopavogur
|
|
||||||
|
|
||||||
home-manager.nixosModules.home-manager {
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.users.marc = {
|
|
||||||
imports = [
|
|
||||||
./home/modules
|
|
||||||
./home/profiles
|
|
||||||
./home/hosts/kopavogur.nix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# - Reykjavik ----------------------------
|
# - Reykjavik ----------------------------
|
||||||
reykjavik = lib.nixosSystem {
|
reykjavik = lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit lib inputs system; };
|
||||||
modules = [
|
modules = [
|
||||||
|
|
||||||
./system/modules
|
./hosts/reykjavik
|
||||||
./system/profiles
|
|
||||||
./system/hosts/reykjavik
|
|
||||||
|
|
||||||
home-manager.nixosModules.home-manager {
|
{
|
||||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
imports =
|
||||||
home-manager.useGlobalPkgs = true;
|
[ inputs.home-manager.nixosModules.home-manager ]
|
||||||
home-manager.useUserPackages = true;
|
# All my personal modules
|
||||||
home-manager.users.marc = {
|
++ (lib.my.mapModulesRec' (toString ./modules) import);
|
||||||
imports = [
|
}
|
||||||
./home/modules
|
|
||||||
./home/profiles
|
];
|
||||||
./home/hosts/reykjavik.nix
|
};
|
||||||
];
|
|
||||||
};
|
# - Kopavogur ----------------------------
|
||||||
|
kopavogur = lib.nixosSystem {
|
||||||
|
inherit system;
|
||||||
|
inherit pkgs;
|
||||||
|
specialArgs = { inherit lib inputs system; };
|
||||||
|
modules = [
|
||||||
|
|
||||||
|
./hosts/kopavogur
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ inputs.home-manager.nixosModules.home-manager ]
|
||||||
|
# All my personal modules
|
||||||
|
++ (lib.my.mapModulesRec' (toString ./modules) import);
|
||||||
}
|
}
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.stateVersion = "22.05";
|
|
||||||
|
|
||||||
samfelag = {
|
|
||||||
profiles = {
|
|
||||||
desktop.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.stateVersion = "22.05";
|
|
||||||
|
|
||||||
samfelag = {
|
|
||||||
modules = {
|
|
||||||
app = {
|
|
||||||
discord.enable = true;
|
|
||||||
spotify.enable = true;
|
|
||||||
};
|
|
||||||
editors.emacs.enable = true;
|
|
||||||
};
|
|
||||||
profiles = {
|
|
||||||
desktop.enable = true;
|
|
||||||
gaming.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./alacritty.nix
|
|
||||||
./discord.nix
|
|
||||||
./spotify.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./app
|
|
||||||
./desktop
|
|
||||||
./dev
|
|
||||||
./editors
|
|
||||||
./shell
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./i3.nix
|
|
||||||
./polybar.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./git.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.samfelag.modules.dev.git;
|
|
||||||
in {
|
|
||||||
|
|
||||||
options.samfelag.modules.dev.git = {
|
|
||||||
enable = lib.mkEnableOption "git config";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
programs.git = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
userName = "marc";
|
|
||||||
userEmail = "marc@sastre.cat";
|
|
||||||
|
|
||||||
extraConfig = {
|
|
||||||
init.defaultBranch = "main";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./emacs.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{ config, inputs, lib, options, pkgs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.samfelag.modules.editors.emacs;
|
|
||||||
in {
|
|
||||||
options.samfelag.modules.editors.emacs = {
|
|
||||||
enable = mkEnableOption "emacs";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
# xdg.configFile."doom".src = ../../../config/doom;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.samfelag.modules.shell;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./zsh.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
options.samfelag.modules.shell = {
|
|
||||||
enable = mkEnableOption "Basic shell config";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
bat
|
|
||||||
exa
|
|
||||||
fd
|
|
||||||
fzf
|
|
||||||
jq
|
|
||||||
ripgrep
|
|
||||||
tldr
|
|
||||||
];
|
|
||||||
|
|
||||||
xdg.configFile."shell".source = ../../../config/.config/shell;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
{
|
|
||||||
samfelag.modules = {
|
|
||||||
|
|
||||||
shell = {
|
|
||||||
enable = true;
|
|
||||||
zsh = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
dev.git.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./common.nix
|
|
||||||
./desktop.nix
|
|
||||||
./gaming.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.samfelag.profiles.desktop;
|
|
||||||
laptopPkgs = with pkgs; [
|
|
||||||
];
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.samfelag.profiles.desktop = {
|
|
||||||
enable = mkEnableOption "desktop profile";
|
|
||||||
laptop = mkOption {
|
|
||||||
description = "Add packages required when machine is a laptop";
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
|
|
||||||
# - Dependencies -----------------------------
|
|
||||||
|
|
||||||
samfelag.modules = {
|
|
||||||
desktop = {
|
|
||||||
i3 = {
|
|
||||||
enable = true;
|
|
||||||
launcher.command = "${pkgs.rofi}/bin/rofi rofi -show run";
|
|
||||||
terminal.command = "${pkgs.alacritty}/bin/alacritty";
|
|
||||||
browser.command = "${pkgs.firefox}/bin/firefox";
|
|
||||||
locker.command = "${pkgs.i3lock-blur}/bin/i3lock-color -c 808F85 && sleep 1";
|
|
||||||
};
|
|
||||||
|
|
||||||
polybar.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
app.alacritty.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.picom.enable = true;
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
rofi
|
|
||||||
firefox
|
|
||||||
|
|
||||||
brightnessctl
|
|
||||||
playerctl
|
|
||||||
feh
|
|
||||||
] ++ optionals cfg.laptop laptopPkgs;
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.samfelag.profiles.gaming;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.samfelag.profiles.gaming = {
|
|
||||||
enable = mkEnableOption "gaming profile";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
|
|
||||||
# - Dependencies -----------------------------
|
|
||||||
|
|
||||||
samfelag.modules = {
|
|
||||||
};
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
lutris
|
|
||||||
];
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# - Basic --------------------------------------
|
||||||
|
|
||||||
|
user.name = "marc";
|
||||||
|
user.shell = pkgs.zsh;
|
||||||
|
networking.hostName = "kopavogur";
|
||||||
|
|
||||||
|
# - Bootloader ---------------------------------
|
||||||
|
|
||||||
|
boot.loader.grub.enable = true;
|
||||||
|
boot.loader.grub.device = "/dev/sda";
|
||||||
|
boot.loader.grub.useOSProber = true;
|
||||||
|
|
||||||
|
# - Modules ------------------------------------
|
||||||
|
|
||||||
|
samfelag.modules = {
|
||||||
|
# - Common -----------------------------------
|
||||||
|
# See modules/common.nix for common packages installed
|
||||||
|
|
||||||
|
# - System -----------------------------------
|
||||||
|
|
||||||
|
# - Desktop ----------------------------------
|
||||||
|
desktop = {
|
||||||
|
enable = true;
|
||||||
|
laptop = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
# - Editors and development ------------------
|
||||||
|
editors.emacs.enable = true;
|
||||||
|
|
||||||
|
dev.git.userName = "marc";
|
||||||
|
dev.git.userEmail = "marc@sastre.cat";
|
||||||
|
|
||||||
|
# - Other apps -------------------------------
|
||||||
|
app.spotify.enable = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,50 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware.nix
|
||||||
|
./nvidia.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# - Basic --------------------------------------
|
||||||
|
|
||||||
|
user.name = "marc";
|
||||||
|
user.shell = pkgs.zsh;
|
||||||
|
networking.hostName = "reykjavik";
|
||||||
|
|
||||||
|
# - Bootloader ---------------------------------
|
||||||
|
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
|
||||||
|
# - Modules ------------------------------------
|
||||||
|
|
||||||
|
samfelag.modules = {
|
||||||
|
# - Common -----------------------------------
|
||||||
|
# See modules/common.nix for common packages installed
|
||||||
|
|
||||||
|
# - System -----------------------------------
|
||||||
|
system.bluetooth.enable = true;
|
||||||
|
|
||||||
|
# - Desktop ----------------------------------
|
||||||
|
desktop = {
|
||||||
|
enable = true;
|
||||||
|
laptop = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
# - Editors and development ------------------
|
||||||
|
editors.emacs.enable = true;
|
||||||
|
|
||||||
|
dev.git.userName = "marc";
|
||||||
|
dev.git.userEmail = "marc@sastre.cat";
|
||||||
|
|
||||||
|
# - Other apps -------------------------------
|
||||||
|
app.spotify.enable = true;
|
||||||
|
|
||||||
|
# - Gaming -----------------------------------
|
||||||
|
gaming.lutris.enable = true;
|
||||||
|
gaming.steam.enable = true;
|
||||||
|
app.discord.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,28 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
with builtins;
|
||||||
|
with lib;
|
||||||
|
rec {
|
||||||
|
# attrsToList
|
||||||
|
attrsToList = attrs:
|
||||||
|
mapAttrsToList (name: value: { inherit name value; }) attrs;
|
||||||
|
|
||||||
|
# mapFilterAttrs ::
|
||||||
|
# (name -> value -> bool)
|
||||||
|
# (name -> value -> { name = any; value = any; })
|
||||||
|
# attrs
|
||||||
|
# Generate an attribute set by mapping a function (f) to it and then filter
|
||||||
|
# by the predicate (pred)
|
||||||
|
mapFilterAttrs = pred: f: attrs: filterAttrs pred (mapAttrs' f attrs);
|
||||||
|
|
||||||
|
# Generate an attribute set by mapping a function over a list of values.
|
||||||
|
genAttrs' = values: f: listToAttrs (map f values);
|
||||||
|
|
||||||
|
# anyAttrs :: (name -> value -> bool) attrs
|
||||||
|
anyAttrs = pred: attrs:
|
||||||
|
any (attr: pred attr.name attr.value) (attrsToList attrs);
|
||||||
|
|
||||||
|
# countAttrs :: (name -> value -> bool) attrs
|
||||||
|
countAttrs = pred: attrs:
|
||||||
|
count (attr: pred attr.name attr.value) (attrsToList attrs);
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
{ inputs, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) makeExtensible attrValues foldr;
|
||||||
|
inherit (modules) mapModules;
|
||||||
|
|
||||||
|
# We define modules, so we can use mapModules
|
||||||
|
modules = import ./modules.nix {
|
||||||
|
inherit lib;
|
||||||
|
self.attrs = import ./attrs.nix { inherit lib; self = {}; };
|
||||||
|
};
|
||||||
|
|
||||||
|
# mylib = {
|
||||||
|
# "attrs" = import "attrs.nix" { selg lib pkgs inputs };
|
||||||
|
# "options" = import "options.nix" { selg lib pkgs inputs };
|
||||||
|
# ...
|
||||||
|
# "extend": <<lambda>>; # from makeExtensible
|
||||||
|
# "__unfix__": <<lambda>>; # from makeExtensible
|
||||||
|
# }
|
||||||
|
mylib = makeExtensible (self:
|
||||||
|
with self; mapModules ./.
|
||||||
|
(file: import file { inherit self lib pkgs inputs; }));
|
||||||
|
in
|
||||||
|
# We have
|
||||||
|
# (attrValues super) = [ (import "attrs.nix" {...}) (import "options.nix" {...}) ... ]
|
||||||
|
# And thus
|
||||||
|
# mylib.extend(...) = (import "attrs.nix" {...}) // (import "options.nix" {...}) // ...
|
||||||
|
# Which is what we want, default.nix returns all modules merged (and extensible)
|
||||||
|
mylib.extend
|
||||||
|
(self: super:
|
||||||
|
foldr (a: b: a // b) {} (attrValues super))
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
{ self, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (builtins) attrValues readDir pathExists concatLists;
|
||||||
|
inherit (lib) id mapAttrsToList filterAttrs hasPrefix hasSuffix nameValuePair removeSuffix;
|
||||||
|
inherit (self.attrs) mapFilterAttrs;
|
||||||
|
in
|
||||||
|
rec {
|
||||||
|
# Returns an attribute set with the keys being the files in a directory
|
||||||
|
# and the values a function applied to their paths
|
||||||
|
# Only *.nix files and directories with a default.nix file are considered.
|
||||||
|
# The ".nix" suffix is removed from the keys of the attribute set.
|
||||||
|
mapModules = dir: fn:
|
||||||
|
mapFilterAttrs
|
||||||
|
(n: v:
|
||||||
|
v != null &&
|
||||||
|
!(hasPrefix "_" n))
|
||||||
|
(n: v:
|
||||||
|
let path = "${toString dir}/${n}"; in
|
||||||
|
if v == "directory" && pathExists "${path}/default.nix"
|
||||||
|
then nameValuePair n (fn path)
|
||||||
|
else if v == "regular" &&
|
||||||
|
n != "default.nix" &&
|
||||||
|
hasSuffix ".nix" n
|
||||||
|
then nameValuePair (removeSuffix ".nix" n) (fn path)
|
||||||
|
else nameValuePair "" null)
|
||||||
|
(readDir dir);
|
||||||
|
|
||||||
|
# Like mapModules above, but it just returns the values
|
||||||
|
# (map the function fn over the files in a directory)
|
||||||
|
mapModules' = dir: fn:
|
||||||
|
attrValues (mapModules dir fn);
|
||||||
|
|
||||||
|
# Like mapModules, but recursive. That is, if there is a directory, the
|
||||||
|
# value will be another attribute set with its contents as keys and the funcion
|
||||||
|
# applied to them as values.
|
||||||
|
mapModulesRec = dir: fn:
|
||||||
|
mapFilterAttrs
|
||||||
|
(n: v:
|
||||||
|
v != null &&
|
||||||
|
!(hasPrefix "_" n))
|
||||||
|
(n: v:
|
||||||
|
let path = "${toString dir}/${n}"; in
|
||||||
|
if v == "directory"
|
||||||
|
then nameValuePair n (mapModulesRec path fn)
|
||||||
|
else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n
|
||||||
|
then nameValuePair (removeSuffix ".nix" n) (fn path)
|
||||||
|
else nameValuePair "" null)
|
||||||
|
(readDir dir);
|
||||||
|
|
||||||
|
# Like mapModulesRec but flattened and only the values. That is, it returns a list
|
||||||
|
# with fn applied to all *.nix files within the directory and subdirectories
|
||||||
|
# excluding default.nix files.
|
||||||
|
mapModulesRec' = dir: fn:
|
||||||
|
let
|
||||||
|
dirs =
|
||||||
|
mapAttrsToList
|
||||||
|
(k: _: "${dir}/${k}")
|
||||||
|
(filterAttrs
|
||||||
|
(n: v: v == "directory" && !(hasPrefix "_" n))
|
||||||
|
(readDir dir));
|
||||||
|
files = attrValues (mapModules dir id);
|
||||||
|
paths = files ++ concatLists (map (d: mapModulesRec' d id) dirs);
|
||||||
|
in map fn paths;
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkOption types;
|
||||||
|
in
|
||||||
|
rec {
|
||||||
|
mkOpt = type: default:
|
||||||
|
mkOption { inherit type default; };
|
||||||
|
|
||||||
|
mkOpt' = type: default: description:
|
||||||
|
mkOption { inherit type default description; };
|
||||||
|
|
||||||
|
mkBoolOpt = default: mkOption {
|
||||||
|
inherit default;
|
||||||
|
type = types.bool;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,21 +1,18 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
cfg = config.samfelag.modules.app.alacritty;
|
cfg = config.samfelag.modules.app.alacritty;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.samfelag.modules.app.alacritty = {
|
options.samfelag.modules.app.alacritty = {
|
||||||
enable = mkEnableOption "alacritty";
|
enable = lib.mkEnableOption "alacritty";
|
||||||
};
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
config = mkIf cfg.enable {
|
fonts.fontconfig.enable = true;
|
||||||
fonts.fontconfig.enable = true;
|
hm.home.packages = with pkgs; [
|
||||||
home.packages = with pkgs; [
|
|
||||||
alacritty
|
alacritty
|
||||||
(nerdfonts.override { fonts = [ "Iosevka" ]; })
|
(nerdfonts.override { fonts = [ "Iosevka" ]; })
|
||||||
];
|
];
|
||||||
|
hm.xdg.configFile."alacritty".source = ../../config/.config/alacritty;
|
||||||
xdg.configFile."alacritty".source = ../../../config/.config/alacritty;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = with pkgs; [
|
hm.home.packages = with pkgs; [
|
||||||
discord
|
discord
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@@ -1,16 +1,14 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
cfg = config.samfelag.modules.app.spotify;
|
cfg = config.samfelag.modules.app.spotify;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.samfelag.modules.app.spotify = {
|
options.samfelag.modules.app.spotify = {
|
||||||
enable = mkEnableOption "spotify";
|
enable = lib.mkEnableOption "spotify";
|
||||||
};
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
config = mkIf cfg.enable {
|
hm.home.packages = with pkgs; [
|
||||||
home.packages = with pkgs; [
|
|
||||||
spotify
|
spotify
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@@ -1,8 +1,15 @@
|
|||||||
|
# Common module
|
||||||
|
# -------------
|
||||||
|
# All configuration common to ANY host is located here.
|
||||||
|
# General configuration and "bare minimum" tools
|
||||||
|
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
# - Nix ----------------------------------------
|
# - Nix ----------------------------------------
|
||||||
|
|
||||||
|
system.stateVersion = "22.05";
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
package = pkgs.nixFlakes;
|
package = pkgs.nixFlakes;
|
||||||
|
|
||||||
@@ -39,12 +46,17 @@
|
|||||||
vim
|
vim
|
||||||
];
|
];
|
||||||
|
|
||||||
# - Other --------------------------------------
|
# - Modules ------------------------------------
|
||||||
|
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
networking.firewall.checkReversePath = "loose"; # See https://github.com/tailscale/tailscale/issues/4432
|
|
||||||
samfelag.modules.tailscale.enable = true;
|
|
||||||
|
|
||||||
system.stateVersion = "22.05";
|
samfelag.modules = {
|
||||||
|
shell.utils.enable = true;
|
||||||
|
shell.zsh.enable = true;
|
||||||
|
dev.git.enable = true;
|
||||||
|
|
||||||
|
# May go away from common if not all hosts use it
|
||||||
|
system.tailscale.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.samfelag.modules.desktop;
|
||||||
|
laptopPkgs = with pkgs; [
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.samfelag.modules.desktop = {
|
||||||
|
|
||||||
|
enable = mkEnableOption "desktop environment";
|
||||||
|
|
||||||
|
laptop = mkOption {
|
||||||
|
description = "Enable features for a laptop (trackpad, battery, etc...)";
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
# - Packages ---------------------------------
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
pamixer
|
||||||
|
i3lock-blur
|
||||||
|
brightnessctl
|
||||||
|
playerctl
|
||||||
|
feh
|
||||||
|
rofi
|
||||||
|
firefox
|
||||||
|
] ++ optionals cfg.laptop laptopPkgs;
|
||||||
|
|
||||||
|
# - Audio ------------------------------------
|
||||||
|
|
||||||
|
sound.enable = true;
|
||||||
|
|
||||||
|
hardware = {
|
||||||
|
pulseaudio = {
|
||||||
|
enable = true;
|
||||||
|
support32Bit = true;
|
||||||
|
package = pkgs.pulseaudioFull;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# - Compositor -------------------------------
|
||||||
|
|
||||||
|
services.picom.enable = true;
|
||||||
|
|
||||||
|
# - Modules ----------------------------------
|
||||||
|
|
||||||
|
samfelag.modules = {
|
||||||
|
app.alacritty.enable = true;
|
||||||
|
desktop.polybar.enable = true;
|
||||||
|
desktop.i3 = {
|
||||||
|
enable = true;
|
||||||
|
laptop = cfg.laptop;
|
||||||
|
launcher.command = "${pkgs.rofi}/bin/rofi rofi -show run";
|
||||||
|
terminal.command = "${pkgs.alacritty}/bin/alacritty";
|
||||||
|
browser.command = "${pkgs.firefox}/bin/firefox";
|
||||||
|
locker.command = "${pkgs.i3lock-blur}/bin/i3lock-color -c 808F85 && sleep 1";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.samfelag.modules.desktop.i3;
|
cfg = config.samfelag.modules.desktop.i3;
|
||||||
mod = "Mod4";
|
mod = "Mod4";
|
||||||
|
|
||||||
@@ -18,12 +18,24 @@ let
|
|||||||
});
|
});
|
||||||
|
|
||||||
system_mode = "System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown";
|
system_mode = "System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown";
|
||||||
|
|
||||||
bg_colour = "#808F85";
|
bg_colour = "#808F85";
|
||||||
|
|
||||||
|
paths = {
|
||||||
|
wallpapers = ../../data/wallpapers;
|
||||||
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options.samfelag.modules.desktop.i3 = {
|
options.samfelag.modules.desktop.i3 = {
|
||||||
enable = lib.mkEnableOption "i3 window manager";
|
enable = lib.mkEnableOption "i3 window manager";
|
||||||
|
|
||||||
|
laptop = lib.mkOption {
|
||||||
|
description = "Enable features for a laptop (trackpad, battery, etc...)";
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
launcher = lib.mkOption {
|
launcher = lib.mkOption {
|
||||||
type = cmdModule;
|
type = cmdModule;
|
||||||
};
|
};
|
||||||
@@ -42,15 +54,45 @@ in {
|
|||||||
|
|
||||||
# - Dependencies -----------------------------
|
# - Dependencies -----------------------------
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
(nerdfonts.override { fonts = [ "Iosevka" ]; })
|
(nerdfonts.override { fonts = [ "Iosevka" ]; })
|
||||||
];
|
];
|
||||||
|
|
||||||
xdg.dataFile."wallpapers".source = ../../../data/wallpapers;
|
hm.xdg.dataFile."wallpapers".source = paths.wallpapers;
|
||||||
|
|
||||||
|
services.xserver = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
libinput = lib.mkIf cfg.laptop {
|
||||||
|
enable = true;
|
||||||
|
touchpad.tapping = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
desktopManager = {
|
||||||
|
xterm.enable = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
displayManager = {
|
||||||
|
defaultSession = "none+i3";
|
||||||
|
lightdm = {
|
||||||
|
enable = true;
|
||||||
|
greeters.mini = {
|
||||||
|
enable = true;
|
||||||
|
user = "marc";
|
||||||
|
extraConfig = ''
|
||||||
|
[greeter]
|
||||||
|
show-sys-info = true
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
windowManager.i3.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
# - Configuration ----------------------------
|
# - Configuration ----------------------------
|
||||||
|
|
||||||
xsession.windowManager.i3 = {
|
hm.xsession.windowManager.i3 = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
@@ -64,7 +106,7 @@ in {
|
|||||||
|
|
||||||
focus.followMouse = false;
|
focus.followMouse = false;
|
||||||
|
|
||||||
bars = [ ];
|
bars = [ ];
|
||||||
|
|
||||||
window = {
|
window = {
|
||||||
border = 1;
|
border = 1;
|
||||||
@@ -76,11 +118,10 @@ in {
|
|||||||
# outer = 5;
|
# outer = 5;
|
||||||
# };
|
# };
|
||||||
|
|
||||||
startup = [
|
startup = [
|
||||||
{ command = "i3-msg workspace 1"; }
|
{ command = "i3-msg workspace 1"; }
|
||||||
{ command = "systemctl --user restart polybar"; always = true; notification = false; }
|
{ command = "systemctl --user restart polybar"; always = true; notification = false; }
|
||||||
{ command = "feh --bg-center -B \"${bg_colour}\" -z --no-fehbg ${config.xdg.dataFile.wallpapers.source}/flors"; always = true; notification = false; }
|
{ command = "feh --bg-center -B \"${bg_colour}\" -z --no-fehbg ${paths.wallpapers}/flors"; always = true; notification = false; }
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
modes = {
|
modes = {
|
||||||
@@ -89,17 +130,17 @@ in {
|
|||||||
"j" = "resize grow height 10 px or 10 ppt";
|
"j" = "resize grow height 10 px or 10 ppt";
|
||||||
"k" = "resize shrink height 10 px or 10 ppt";
|
"k" = "resize shrink height 10 px or 10 ppt";
|
||||||
"l" = "resize grow width 10 px or 10 ppt";
|
"l" = "resize grow width 10 px or 10 ppt";
|
||||||
|
|
||||||
"Left" = "resize shrink width 10 px or 10 ppt";
|
"Left" = "resize shrink width 10 px or 10 ppt";
|
||||||
"Down" = "resize grow height 10 px or 10 ppt";
|
"Down" = "resize grow height 10 px or 10 ppt";
|
||||||
"Up" = "resize shrink height 10 px or 10 ppt";
|
"Up" = "resize shrink height 10 px or 10 ppt";
|
||||||
"Right" = "resize grow width 10 px or 10 ppt";
|
"Right" = "resize grow width 10 px or 10 ppt";
|
||||||
|
|
||||||
"Return" = "mode \"default\"";
|
"Return" = "mode \"default\"";
|
||||||
"Escape" = "mode \"default\"";
|
"Escape" = "mode \"default\"";
|
||||||
};
|
};
|
||||||
|
|
||||||
"${system_mode}" = {
|
"${system_mode}" = {
|
||||||
"l" = "exec --no-startup-id ${cfg.locker.command}, mode \"default\"";
|
"l" = "exec --no-startup-id ${cfg.locker.command}, mode \"default\"";
|
||||||
"e" = "exec --no-startup-id i3-msg exit, mode \"default\"";
|
"e" = "exec --no-startup-id i3-msg exit, mode \"default\"";
|
||||||
"s" = "exec --no-startup-id ${cfg.locker.command} && systemctl suspend, mode \"default\"";
|
"s" = "exec --no-startup-id ${cfg.locker.command} && systemctl suspend, mode \"default\"";
|
||||||
@@ -138,18 +179,18 @@ in {
|
|||||||
# split orientation
|
# split orientation
|
||||||
"${mod}+z" = "split h;exec notify-send 'tile horizontally'";
|
"${mod}+z" = "split h;exec notify-send 'tile horizontally'";
|
||||||
"${mod}+v" = "split v;exec notify-send 'tile vertically'";
|
"${mod}+v" = "split v;exec notify-send 'tile vertically'";
|
||||||
|
|
||||||
# enter fullscreen mode for the focused container
|
# enter fullscreen mode for the focused container
|
||||||
"${mod}+f" = "fullscreen toggle";
|
"${mod}+f" = "fullscreen toggle";
|
||||||
|
|
||||||
# change container layout (stacked, tabbed, toggle split)
|
# change container layout (stacked, tabbed, toggle split)
|
||||||
"${mod}+s" = "layout stacking";
|
"${mod}+s" = "layout stacking";
|
||||||
"${mod}+w" = "layout tabbed";
|
"${mod}+w" = "layout tabbed";
|
||||||
"${mod}+e" = "layout toggle split";
|
"${mod}+e" = "layout toggle split";
|
||||||
|
|
||||||
# toggle tiling / floating
|
# toggle tiling / floating
|
||||||
"${mod}+Shift+space" = "floating toggle";
|
"${mod}+Shift+space" = "floating toggle";
|
||||||
|
|
||||||
# focus the parent container
|
# focus the parent container
|
||||||
"${mod}+a" = "focus parent";
|
"${mod}+a" = "focus parent";
|
||||||
|
|
||||||
@@ -163,18 +204,18 @@ in {
|
|||||||
|
|
||||||
# - Media ------------------------------
|
# - Media ------------------------------
|
||||||
|
|
||||||
# Pulse Audio controls
|
# Pulse Audio controls
|
||||||
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||||
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||||
"Shift+XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +1%";
|
"Shift+XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +1%";
|
||||||
"Shift+XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -1%";
|
"Shift+XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -1%";
|
||||||
"XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
"XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||||
|
|
||||||
# Media player controls
|
# Media player controls
|
||||||
"XF86AudioPlay" = "exec playerctl play-pause";
|
"XF86AudioPlay" = "exec playerctl play-pause";
|
||||||
"XF86AudioPause" = "exec playerctl play-pause";
|
"XF86AudioPause" = "exec playerctl play-pause";
|
||||||
"XF86AudioNext" = "exec playerctl next";
|
"XF86AudioNext" = "exec playerctl next";
|
||||||
"XF86AudioPrev" = "exec playerctl previous";
|
"XF86AudioPrev" = "exec playerctl previous";
|
||||||
"XF86AudioStop" = "exec playerctl stop";
|
"XF86AudioStop" = "exec playerctl stop";
|
||||||
|
|
||||||
# - Workspaces -------------------------
|
# - Workspaces -------------------------
|
||||||
@@ -10,6 +10,12 @@ let
|
|||||||
polybar top &
|
polybar top &
|
||||||
polybar bottom &
|
polybar bottom &
|
||||||
'';
|
'';
|
||||||
|
# Paths
|
||||||
|
paths = {
|
||||||
|
config = ../../config/.config/polybar/config.ini;
|
||||||
|
bars = ../../config/.config/polybar/bars;
|
||||||
|
scripts = ../../config/.config/polybar/scripts;
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options.samfelag.modules.desktop.polybar = {
|
options.samfelag.modules.desktop.polybar = {
|
||||||
@@ -20,19 +26,19 @@ in {
|
|||||||
|
|
||||||
# - Configuration ----------------------------
|
# - Configuration ----------------------------
|
||||||
|
|
||||||
home.packages = [
|
environment.systemPackages = [
|
||||||
polybar_pkg
|
polybar_pkg
|
||||||
];
|
];
|
||||||
|
|
||||||
xdg.configFile."polybar/config.ini".source = ../../../config/.config/polybar/config.ini;
|
hm.xdg.configFile."polybar/config.ini".source = paths.config;
|
||||||
xdg.configFile."polybar/bars".source = ../../../config/.config/polybar/bars;
|
hm.xdg.configFile."polybar/bars".source = paths.bars;
|
||||||
xdg.configFile."polybar/scripts".source = ../../../config/.config/polybar/scripts;
|
hm.xdg.configFile."polybar/scripts".source = paths.scripts;
|
||||||
|
|
||||||
systemd.user.services.polybar = {
|
hm.systemd.user.services.polybar = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Polybar status bar";
|
Description = "Polybar status bar";
|
||||||
PartOf = [ "tray.target" ];
|
PartOf = [ "tray.target" ];
|
||||||
X-Restart-Triggers = [ "${config.xdg.configFile."polybar/config.ini".source}" ];
|
X-Restart-Triggers = [ "${paths.config}" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.samfelag.modules.dev.git;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.samfelag.modules.dev.git = with lib.types; {
|
||||||
|
enable = lib.mkEnableOption "git";
|
||||||
|
userName = lib.my.mkOpt str config.user.name;
|
||||||
|
userEmail = lib.my.mkOpt (nullOr str) null;
|
||||||
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
git
|
||||||
|
];
|
||||||
|
hm.programs.git = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
userName = cfg.userName;
|
||||||
|
userEmail = cfg.userEmail;
|
||||||
|
|
||||||
|
extraConfig = {
|
||||||
|
init.defaultBranch = "main";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -33,7 +33,8 @@ in {
|
|||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
## Emacs itself
|
## Emacs itself
|
||||||
binutils
|
binutils
|
||||||
emacs
|
((emacsPackagesFor emacsNativeComp).emacsWithPackages
|
||||||
|
(epkgs: [ epkgs.vterm ]))
|
||||||
# emacsPgtkGcc
|
# emacsPgtkGcc
|
||||||
|
|
||||||
## Doom dependencies
|
## Doom dependencies
|
||||||
@@ -47,7 +48,13 @@ in {
|
|||||||
pinentry_emacs
|
pinentry_emacs
|
||||||
zstd
|
zstd
|
||||||
|
|
||||||
# ## Modules deps
|
## Modules deps
|
||||||
|
# :tools vterm
|
||||||
|
gcc
|
||||||
|
gnumake
|
||||||
|
libtool
|
||||||
|
cmake
|
||||||
|
|
||||||
# # :lang cc
|
# # :lang cc
|
||||||
# ccls
|
# ccls
|
||||||
# cmake
|
# cmake
|
||||||
@@ -74,10 +81,6 @@ in {
|
|||||||
# sqlite
|
# sqlite
|
||||||
# # :tools direnv
|
# # :tools direnv
|
||||||
# direnv
|
# direnv
|
||||||
# # :tools vterm
|
|
||||||
# gcc
|
|
||||||
# gnumake
|
|
||||||
# libtool
|
|
||||||
|
|
||||||
# Fonts
|
# Fonts
|
||||||
emacs-all-the-icons-fonts
|
emacs-all-the-icons-fonts
|
||||||
@@ -89,20 +92,9 @@ in {
|
|||||||
|
|
||||||
fonts.fonts = [ pkgs.emacs-all-the-icons-fonts ];
|
fonts.fonts = [ pkgs.emacs-all-the-icons-fonts ];
|
||||||
|
|
||||||
# env.PATH = [ "$XDG_CONFIG_HOME/emacs/bin" ];
|
env.PATH = [ "$XDG_CONFIG_HOME/emacs/bin" ];
|
||||||
|
|
||||||
environment.sessionVariables = rec {
|
home-manager.users.marc.xdg.configFile."doom".source = ../../config/doom;
|
||||||
XDG_CACHE_HOME = "$HOME/.cache";
|
|
||||||
XDG_CONFIG_HOME = "$HOME/.config";
|
|
||||||
XDG_BIN_HOME = "$HOME/.local/bin";
|
|
||||||
XDG_DATA_HOME = "$HOME/.local/share";
|
|
||||||
|
|
||||||
PATH = [
|
|
||||||
"$HOME/.config/emacs/bin"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.marc.xdg.configFile."doom".source = ../../../config/doom;
|
|
||||||
|
|
||||||
system.userActivationScripts = {
|
system.userActivationScripts = {
|
||||||
installDoomEmacs = ''
|
installDoomEmacs = ''
|
||||||
@@ -110,7 +102,7 @@ in {
|
|||||||
echo $XDG_CONFIG_HOME
|
echo $XDG_CONFIG_HOME
|
||||||
echo $EMACS_FOLDER
|
echo $EMACS_FOLDER
|
||||||
if [ ! -d "$EMACS_FOLDER" ]; then
|
if [ ! -d "$EMACS_FOLDER" ]; then
|
||||||
${pkgs.git}/bin/git clone --depth=1 --single-branch "https://github.com/doomemacs/doomemacs" "$EMACS_FOLDER"
|
${pkgs.git}/bin/git clone --depth=1 --single-branch "https://github.com/doomemacs/doomemacs" "$EMACS_FOLDER"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.samfelag.modules.gaming.lutris;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.samfelag.modules.gaming.lutris = {
|
||||||
|
enable = lib.mkEnableOption "lutris";
|
||||||
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
hm.home.packages = with pkgs; [
|
||||||
|
lutris
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,14 +1,12 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.samfelag.profiles.gaming;
|
cfg = config.samfelag.modules.gaming.steam;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.samfelag.profiles.gaming = {
|
options.samfelag.modules.gaming.steam = {
|
||||||
|
enable = lib.mkEnableOption "steam";
|
||||||
enable = lib.mkEnableOption "gaming profile";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
programs.steam = {
|
programs.steam = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
{ config, options, lib, home-manager, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
with lib.my;
|
||||||
|
{
|
||||||
|
options = with types; {
|
||||||
|
user = mkOpt attrs {};
|
||||||
|
|
||||||
|
hm = mkOpt attrs {};
|
||||||
|
|
||||||
|
env = mkOption {
|
||||||
|
# env = { PATH = ["$PATH" ./test]; TEST = "test"; }
|
||||||
|
type = attrsOf (oneOf [ str path (listOf (either str path)) ]);
|
||||||
|
# env = { PATH = "$PATH:./test"; TEST = "test"; }
|
||||||
|
apply = mapAttrs
|
||||||
|
(n: v: if isList v
|
||||||
|
then concatMapStringsSep ":" (x: toString x) v
|
||||||
|
else (toString v));
|
||||||
|
default = {};
|
||||||
|
description = "Set environment variables that will be joined by a colon";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
user = {
|
||||||
|
description = "The primary user account";
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
isNormalUser = true;
|
||||||
|
home = "/home/${config.user.name}";
|
||||||
|
group = "users";
|
||||||
|
uid = 1000;
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.${config.user.name} = mkAliasDefinitions options.user;
|
||||||
|
|
||||||
|
nix.settings = let users = [ "root" config.user.name ]; in {
|
||||||
|
trusted-users = users;
|
||||||
|
allowed-users = users;
|
||||||
|
};
|
||||||
|
|
||||||
|
hm.home.stateVersion = config.system.stateVersion;
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
# extraSpecialArgs = { inherit inputs; };
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
|
||||||
|
users.${config.user.name} = mkAliasDefinitions options.hm;
|
||||||
|
};
|
||||||
|
|
||||||
|
env.PATH = [ "$PATH" ];
|
||||||
|
|
||||||
|
environment.extraInit =
|
||||||
|
concatStringsSep "\n"
|
||||||
|
(mapAttrsToList (n: v: "export ${n}=\"${v}\"") config.env);
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.samfelag.modules.shell.utils;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.samfelag.modules.shell.utils = {
|
||||||
|
enable = lib.mkEnableOption "Basic shell utils";
|
||||||
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
bat
|
||||||
|
exa
|
||||||
|
fd
|
||||||
|
fzf
|
||||||
|
jq
|
||||||
|
ripgrep
|
||||||
|
tldr
|
||||||
|
];
|
||||||
|
hm.xdg.configFile."shell".source = ../../config/.config/shell;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,23 +1,21 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
cfg = config.samfelag.modules.shell.zsh;
|
cfg = config.samfelag.modules.shell.zsh;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.samfelag.modules.shell.zsh = {
|
options.samfelag.modules.shell.zsh = {
|
||||||
enable = mkEnableOption "zsh configuration";
|
enable = lib.mkEnableOption "zsh";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
home.packages = with pkgs; [
|
|
||||||
zsh
|
zsh
|
||||||
zsh-powerlevel10k
|
zsh-powerlevel10k
|
||||||
(nerdfonts.override { fonts = [ "Iosevka" ]; })
|
(nerdfonts.override { fonts = [ "Iosevka" ]; })
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.zsh = {
|
hm.programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dotDir = ".config/zsh";
|
dotDir = ".config/zsh";
|
||||||
|
|
||||||
@@ -32,7 +30,7 @@ in
|
|||||||
emulate bash -c ". $rc"
|
emulate bash -c ". $rc"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Source zsh specific configuration
|
# Source zsh specific configuration
|
||||||
if [[ -d $HOME/.config/shell/zsh ]]; then
|
if [[ -d $HOME/.config/shell/zsh ]]; then
|
||||||
for rc in $HOME/.config/shell/zsh/*.zsh; do
|
for rc in $HOME/.config/shell/zsh/*.zsh; do
|
||||||
@@ -64,7 +62,7 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile."zsh/.p10k.zsh".source = ../../../config/.config/zsh/.p10k.zsh;
|
hm.xdg.configFile."zsh/.p10k.zsh".source = ../../config/.config/zsh/.p10k.zsh;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,14 @@
|
|||||||
{ config, lib, pkgs, self, ... }:
|
{ config, lib, pkgs, self, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.samfelag.modules.bluetooth;
|
cfg = config.samfelag.modules.system.bluetooth;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.samfelag.modules.bluetooth = {
|
options.samfelag.modules.system.bluetooth = {
|
||||||
enable = lib.mkEnableOption "bluetooth";
|
enable = lib.mkEnableOption "bluetooth";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth.enable = true;
|
||||||
services.blueman.enable = true;
|
services.blueman.enable = true;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.samfelag.modules.system.tailscale;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.samfelag.modules.system.tailscale = {
|
||||||
|
enable = lib.mkEnableOption "tailscale";
|
||||||
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
# See https://github.com/tailscale/tailscale/issues/4432
|
||||||
|
networking.firewall.checkReversePath = "loose";
|
||||||
|
services.tailscale.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./hardware.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# - Basic --------------------------------------
|
|
||||||
|
|
||||||
networking.hostName = "kopavogur";
|
|
||||||
|
|
||||||
samfelag.modules.user = {
|
|
||||||
name = "marc";
|
|
||||||
};
|
|
||||||
|
|
||||||
# - Bootloader ---------------------------------
|
|
||||||
|
|
||||||
boot.loader.grub.enable = true;
|
|
||||||
boot.loader.grub.device = "/dev/sda";
|
|
||||||
boot.loader.grub.useOSProber = true;
|
|
||||||
|
|
||||||
# - Services -----------------------------------
|
|
||||||
|
|
||||||
samfelag.profiles.desktop.enable = true;
|
|
||||||
|
|
||||||
system.stateVersion = "22.05";
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./hardware.nix
|
|
||||||
./nvidia.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# - Basic --------------------------------------
|
|
||||||
|
|
||||||
networking.hostName = "reykjavik";
|
|
||||||
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
|
|
||||||
# - Modules ------------------------------------
|
|
||||||
|
|
||||||
samfelag.modules = {
|
|
||||||
user.name = "marc";
|
|
||||||
bluetooth.enable = true;
|
|
||||||
editors.emacs.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
# - Profiles -----------------------------------
|
|
||||||
|
|
||||||
samfelag.profiles = {
|
|
||||||
desktop = {
|
|
||||||
enable = true;
|
|
||||||
laptop = true;
|
|
||||||
};
|
|
||||||
gaming.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "22.05";
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./editors
|
|
||||||
./bluetooth.nix
|
|
||||||
./tailscale.nix
|
|
||||||
./user.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./emacs.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{ config, lib, pkgs, self, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.samfelag.modules.tailscale;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.samfelag.modules.tailscale = {
|
|
||||||
enable = lib.mkEnableOption "tailscale";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
services.tailscale = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
{ config, lib, pkgs, self, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.samfelag.modules.user;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.samfelag.modules.user = {
|
|
||||||
name = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "marc";
|
|
||||||
description = ''
|
|
||||||
Specifies the user name
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkMerge [
|
|
||||||
{
|
|
||||||
programs.zsh.enable = true;
|
|
||||||
|
|
||||||
users = {
|
|
||||||
defaultUserShell = pkgs.zsh;
|
|
||||||
users."${cfg.name}" = with cfg; {
|
|
||||||
description = "Marc Sastre Rienitz";
|
|
||||||
isNormalUser = true;
|
|
||||||
extraGroups = [ "networkmanager" "wheel" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Do not allow users to be added or modified except through Nix configuration.
|
|
||||||
# mutableUsers = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
nix.settings.trusted-users = [ "${cfg.name}" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./common.nix
|
|
||||||
./desktop.nix
|
|
||||||
./gaming.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.samfelag.profiles.desktop;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.samfelag.profiles.desktop = {
|
|
||||||
|
|
||||||
enable = mkEnableOption "desktop profile";
|
|
||||||
|
|
||||||
laptop = mkOption {
|
|
||||||
description = "Enable features for a laptop (trackpad, battery, etc...)";
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
|
|
||||||
# - Packages ---------------------------------
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
pamixer
|
|
||||||
i3lock-blur
|
|
||||||
];
|
|
||||||
|
|
||||||
# - Audio ------------------------------------
|
|
||||||
|
|
||||||
sound.enable = true;
|
|
||||||
|
|
||||||
hardware = {
|
|
||||||
pulseaudio = {
|
|
||||||
enable = true;
|
|
||||||
support32Bit = true;
|
|
||||||
package = pkgs.pulseaudioFull;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# - Window + Display Manager -----------------
|
|
||||||
|
|
||||||
environment.pathsToLink = [ "/libexec" ];
|
|
||||||
|
|
||||||
services.xserver = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
libinput = mkIf cfg.laptop {
|
|
||||||
enable = true;
|
|
||||||
touchpad.tapping = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
desktopManager = {
|
|
||||||
xterm.enable = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
displayManager = {
|
|
||||||
defaultSession = "none+i3";
|
|
||||||
lightdm = {
|
|
||||||
enable = true;
|
|
||||||
greeters.mini = {
|
|
||||||
enable = true;
|
|
||||||
user = "marc";
|
|
||||||
extraConfig = ''
|
|
||||||
[greeter]
|
|
||||||
show-sys-info = true
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
windowManager.i3.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user