From 8781b2d636e8cea698a7351b8d3cdb3c192551dd Mon Sep 17 00:00:00 2001 From: Sense T Date: Mon, 26 Jun 2023 06:18:07 +0800 Subject: [PATCH] mass update --- flake.lock | 101 ++++++++++++++++++++++++++++++ flake.nix | 6 +- global/software-configuration.nix | 2 +- home/user/default.nix | 13 ++-- home/user/home.nix | 72 ++++++++++----------- home/user/programs.nix | 98 +++++++++++++++-------------- home/user/services.nix | 30 ++++----- home/user/systemd.nix | 4 -- 8 files changed, 217 insertions(+), 109 deletions(-) create mode 100644 flake.lock delete mode 100644 home/user/systemd.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4e03e74 --- /dev/null +++ b/flake.lock @@ -0,0 +1,101 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1638122382, + "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1687647567, + "narHash": "sha256-Ua90LZYJO7/7KW/KK/AqijhIekd+wxPwbVKXuBYzJeQ=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "6ca1e16eb3016c94b7ac16699e1d4158bd4e39a4", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-23.05", + "repo": "home-manager", + "type": "github" + } + }, + "impermanence": { + "locked": { + "lastModified": 1684264534, + "narHash": "sha256-K0zr+ry3FwIo3rN2U/VWAkCJSgBslBisvfRIPwMbuCQ=", + "owner": "nix-community", + "repo": "impermanence", + "rev": "89253fb1518063556edd5e54509c30ac3089d5e6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "impermanence", + "type": "github" + } + }, + "nixos-cn": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1682818384, + "narHash": "sha256-l8jh9BQj6nfjPDYGyrZkZwX1GaOqBX+pBHU+7fFZU3w=", + "owner": "nixos-cn", + "repo": "flakes", + "rev": "2d475ec68cca251ef6c6c69a9224db5c264c5e5b", + "type": "github" + }, + "original": { + "owner": "nixos-cn", + "repo": "flakes", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1687555006, + "narHash": "sha256-GD2Kqb/DXQBRJcHqkM2qFZqbVenyO7Co/80JHRMg2U0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "33223d479ffde3d05ac16c6dff04ae43cc27e577", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-23.05", + "type": "indirect" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "impermanence": "impermanence", + "nixos-cn": "nixos-cn", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} \ No newline at end of file diff --git a/flake.nix b/flake.nix index 23110c7..6667c35 100644 --- a/flake.nix +++ b/flake.nix @@ -25,13 +25,13 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - inputs.nixos-cn = { + nixos-cn = { url = "github:nixos-cn/flakes"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = {self, nixpkgs, home-manager, nixos-cn,...}: { + outputs = {self, nixpkgs, home-manager, nixos-cn, impermanence, ...}: { nixosConfigurations.gpd = nixpkgs.lib.nixosSystem rec { system = "x86_64-linux"; @@ -54,7 +54,7 @@ home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.users = import ./per-user; + home-manager.users = import ./home; } ]; }; diff --git a/global/software-configuration.nix b/global/software-configuration.nix index 54873a2..ed7e775 100644 --- a/global/software-configuration.nix +++ b/global/software-configuration.nix @@ -2,7 +2,7 @@ xdg.portal = { enable = true; wlr.enable = true; - } + }; # Enable automatic login for the user. services = { diff --git a/home/user/default.nix b/home/user/default.nix index b94ccda..e3ec139 100644 --- a/home/user/default.nix +++ b/home/user/default.nix @@ -1,8 +1,13 @@ {pkgs, ...}: { - home = import ./home.nix; - programs = import ./programs.nix; - services = import ./services.nix; - systemd.user.services = import ./systemd.nix; + imports = [ + ./home.nix + ./programs.nix + ./services.nix + ]; + + systemd.user.services = { + # TODO: Podman + }; i18n.inputMethod.enabled = "fcitx5"; i18n.inputMethod.fcitx5.addons = with pkgs; [ diff --git a/home/user/home.nix b/home/user/home.nix index 6036e3e..cee1fe1 100644 --- a/home/user/home.nix +++ b/home/user/home.nix @@ -1,44 +1,46 @@ {pkgs, ...}: { - stateVersion = "23.05"; # Static - username = "GPD User"; - homeDirectory = "/home/user"; + home = { + stateVersion = "23.05"; # Static + username = "GPD User"; + homeDirectory = "/home/user"; - packages = with pkgs; [ - btop - bat - thefuck - ranger - icdiff - podman - jdk17 - rofi - rofi-rbw - ]; + packages = with pkgs; [ + btop + bat + thefuck + ranger + icdiff + podman + jdk17 + rofi + rofi-rbw + ]; - sessionPath = { - ".local/bin" - "Applications" - } + sessionPath = [ + ".local/bin" + "Applications" + ]; - shellAliases = { - cao = "fuck"; - top = "btop"; - ls = "ls --color=auto"; - cat = "bat -p --paging=never -u"; - diff="icdiff"; - }; + shellAliases = { + cao = "fuck"; + top = "btop"; + ls = "ls --color=auto"; + cat = "bat -p --paging=never -u"; + diff="icdiff"; + }; - file = { - # hyprland - ".config/hypr/hyprland.conf".source = ./files/hyprland.conf; + file = { + # hyprland + ".config/hypr/hyprland.conf".source = ./files/hyprland.conf; - # Use flatseal to change permissions. - ".local/share/fonts".source = /run/current-system/sw/share/X11/fonts + # Use flatseal to change permissions. + ".local/share/fonts".source = /run/current-system/sw/share/X11/fonts; - # Fix flatpak fonts - ".local/share/flatpak/overrides/global".text = '' - [Context] - filesystems=~/.local/share/fonts:ro;~/.icons; - ''; + # Fix flatpak fonts + ".local/share/flatpak/overrides/global".text = '' + [Context] + filesystems=~/.local/share/fonts:ro;~/.icons; + ''; + }; }; } \ No newline at end of file diff --git a/home/user/programs.nix b/home/user/programs.nix index 9703241..9d05398 100644 --- a/home/user/programs.nix +++ b/home/user/programs.nix @@ -1,63 +1,65 @@ {pkgs, ...}: { - home-manager.enable = true; + programs = { + home-manager.enable = true; - vim = { - enable = true; - defaultEditor = true; - }; - - zsh = { - enable = true; - enableSyntaxHighlighting = true; - - oh-my-zsh = { + vim = { enable = true; - plugins = [ "sudo" "git" "golang" "thefuck" "kubectl" "emoji" "pip" "npm" "yarn" "vscode" ]; - theme = "agnoster"; - }; - }; - - waybar = { - enable = true; - systemd.enable = true; - # see https://github.com/theCode-Breaker/riverwm/blob/main/waybar/river/config-river - # https://blog.cascade.moe/posts/hyprland-configure/ - settings = { - mainBar = import ./config/waybar.nix; + defaultEditor = true; }; - style = import ./config/waybar-style.nix; - }; + zsh = { + enable = true; + enableSyntaxHighlighting = true; - kitty = { - enable = true; - font = { - name = "Powerline"; - size = 12; + oh-my-zsh = { + enable = true; + plugins = [ "sudo" "git" "golang" "thefuck" "kubectl" "emoji" "pip" "npm" "yarn" "vscode" ]; + theme = "agnoster"; + }; }; - keybindings = { - "ctrl+c" = "copy_or_interrupt"; - "ctrl+v" = "paste_from_clipboard"; + waybar = { + enable = true; + systemd.enable = true; + # see https://github.com/theCode-Breaker/riverwm/blob/main/waybar/river/config-river + # https://blog.cascade.moe/posts/hyprland-configure/ + settings = { + mainBar = import ./config/waybar.nix; + }; + + style = import ./config/waybar-style.nix; }; - shellIntegration = { - enableZshIntegration = true; - enableBashIntegration = true; + kitty = { + enable = true; + font = { + name = "Powerline"; + size = 12; + }; + + keybindings = { + "ctrl+c" = "copy_or_interrupt"; + "ctrl+v" = "paste_from_clipboard"; + }; + + shellIntegration = { + enableZshIntegration = true; + enableBashIntegration = true; + }; + + settings = { + background_opacity = 0.8; + }; }; - settings = { - background_opacity = 0.8; - }; - }; - - rbw = { - enable = true; - settings = { - base_url = "https://pass.sense-t.eu.org"; - email = "sense-t@sense-t.eu.org"; - lock_timeout = 300; - pinentry = "gnome3"; + rbw = { + enable = true; + settings = { + base_url = "https://pass.sense-t.eu.org"; + email = "sense-t@sense-t.eu.org"; + lock_timeout = 300; + pinentry = "gnome3"; + }; }; }; } \ No newline at end of file diff --git a/home/user/services.nix b/home/user/services.nix index da37970..ec91104 100644 --- a/home/user/services.nix +++ b/home/user/services.nix @@ -1,19 +1,21 @@ { - dunst = { - enable = true; - settings = { - global = { - width = 300; - height = 300; - offset = "30x50"; - origin = "top-right"; - notification_limit = 10; - progress_bar = true; - transparency = 20; - corner_radius = 8; + services = { + dunst = { + enable = true; + settings = { + global = { + width = 300; + height = 300; + offset = "30x50"; + origin = "top-right"; + notification_limit = 10; + progress_bar = true; + transparency = 20; + corner_radius = 8; + }; }; }; - }; - network-manager-applet.enable = true; + network-manager-applet.enable = true; + }; } \ No newline at end of file diff --git a/home/user/systemd.nix b/home/user/systemd.nix deleted file mode 100644 index 5daf766..0000000 --- a/home/user/systemd.nix +++ /dev/null @@ -1,4 +0,0 @@ -# Will used for podman -{ - -} \ No newline at end of file