From 7c7591e167311545f4e5a532dd21247b651b15d7 Mon Sep 17 00:00:00 2001 From: ryan4yin Date: Thu, 25 May 2023 23:34:38 +0800 Subject: [PATCH] feat: switch to x11 + i3 --- flake.lock | 39 +++++++++++++++++++++++++++++++++++ flake.nix | 4 ++-- home/programs/common.nix | 3 +++ hosts/msi-rtx4090/default.nix | 4 ++-- modules/hyprland.nix | 15 -------------- modules/system.nix | 15 ++++++++++++++ 6 files changed, 61 insertions(+), 19 deletions(-) diff --git a/flake.lock b/flake.lock index 3d399ad0..1858dbcd 100644 --- a/flake.lock +++ b/flake.lock @@ -43,6 +43,27 @@ "type": "github" } }, + "darwin_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs-darwin" + ] + }, + "locked": { + "lastModified": 1684774948, + "narHash": "sha256-hJTaw4dYzcB+lsasKejnafq0CxPsVetn9RLXrcL+4jE=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "b8c286c82c6b47826a6c0377e7017052ad91353c", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "devenv": { "inputs": { "flake-compat": "flake-compat", @@ -426,6 +447,22 @@ "type": "github" } }, + "nixpkgs-darwin": { + "locked": { + "lastModified": 1684968804, + "narHash": "sha256-y78lDeiJC/MSOM6HBe1VI5G2lrrmJMkWigRuOrf20uA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f69907854223d6d49f75b1ae52b2f6567f711d90", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-23.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-lib": { "locked": { "lastModified": 1681001314, @@ -652,12 +689,14 @@ "root": { "inputs": { "agenix": "agenix", + "darwin": "darwin_2", "devenv": "devenv", "home-manager": "home-manager_2", "hyprland": "hyprland", "nil": "nil", "nixos-generators": "nixos-generators", "nixpkgs": "nixpkgs_5", + "nixpkgs-darwin": "nixpkgs-darwin", "nixpkgs-stable": "nixpkgs-stable_2", "nixpkgs-wayland": "nixpkgs-wayland", "nur": "nur" diff --git a/flake.nix b/flake.nix index de7836d7..d5630f94 100644 --- a/flake.nix +++ b/flake.nix @@ -42,7 +42,7 @@ darwin = { url = "github:lnl7/nix-darwin/master"; inputs.nixpkgs.follows = "nixpkgs-darwin"; - } + }; # nix users repository # used to install some packages not in nixpkgs @@ -102,7 +102,7 @@ # 使用 home-manager.extraSpecialArgs 自定义传递给 ./home 的参数 home-manager.extraSpecialArgs = inputs; - home-manager.users.ryan = import ./home/home-wayland.nix; + home-manager.users.ryan = import ./home/home-x11.nix; } ]; }; diff --git a/home/programs/common.nix b/home/programs/common.nix index a1c46972..c499a25d 100644 --- a/home/programs/common.nix +++ b/home/programs/common.nix @@ -104,6 +104,9 @@ ltrace # library call monitoring lsof mtr + + # A tool to create bootable live USB drives from ISO images + unetbootin ]; programs = { diff --git a/hosts/msi-rtx4090/default.nix b/hosts/msi-rtx4090/default.nix index e5164d1a..8315c33b 100644 --- a/hosts/msi-rtx4090/default.nix +++ b/hosts/msi-rtx4090/default.nix @@ -16,8 +16,8 @@ ./hardware-configuration.nix ../../modules/fhs-fonts.nix - ../../modules/hyprland.nix - #../../modules/i3.nix + # ../../modules/hyprland.nix + ../../modules/i3.nix ../../modules/nur-packages.nix ../../modules/system.nix ../../modules/user_group.nix diff --git a/modules/hyprland.nix b/modules/hyprland.nix index 1b3598ce..61e81830 100644 --- a/modules/hyprland.nix +++ b/modules/hyprland.nix @@ -71,19 +71,4 @@ ncmpcpp # a mpd client with a UI networkmanagerapplet # provide GUI app: nm-connection-editor ]; - - xdg.portal = { - enable = true; - wlr.enable = true; - xdgOpenUsePortal = true; - extraPortals = with pkgs; [ - xdg-desktop-portal-wlr # for wlroots based compositors - xdg-desktop-portal-gtk # for gtk - # xdg-desktop-portal-kde # for kde - ]; - }; - - # for power management - services.upower.enable = true; - } diff --git a/modules/system.nix b/modules/system.nix index ba4f3eac..71953f6d 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -220,4 +220,19 @@ # android development tools, this will install adb/fastboot and other android tools and udev rules # see https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/programs/adb.nix programs.adb.enable = true; + + + xdg.portal = { + enable = true; + wlr.enable = true; + xdgOpenUsePortal = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-wlr # for wlroots based compositors + xdg-desktop-portal-gtk # for gtk + # xdg-desktop-portal-kde # for kde + ]; + }; + + # for power management + services.upower.enable = true; } \ No newline at end of file