Coder Social home page Coder Social logo

ruixi-rebirth / melted-flakes Goto Github PK

View Code? Open in Web Editor NEW
454.0 4.0 35.0 34.6 MB

My presonal NixOS config.New config can get in https://github.com/Ruixi-rebirth/flakes

Nix 78.78% Shell 2.43% Haskell 0.01% Lua 18.77% Nushell 0.01%
hyprland nixos sway waybar bspwm dotfiles polybar flake

melted-flakes's Introduction

简体中文(**大陆) | English (UK)

Ruixi-rebirth's NixOS Config

系统组件

NixOS(Wayland) Nixos(Xorg)
Window Manager Sway, Hyprland bspwm
Terminal Emulator Kitty Kitty
Bar Waybar Polybar
Application Launcher Rofi-wayland rofi
Notification Daemon Mako Dunst
Display Manager None(TTY1 Login) None(TTY1 Login)
network management tool NetworkManager NetworkManager
Input method framework Fcitx5 Fcitx5
System resource monitor Btop Btop
File Manager Ranger, Nemo Ranger, Nemo
Lockscreen Swaylock-effects i3lock-fancy
Shell Fish Fish
Music Player mpd, ncmpcpp, mpc, Netease-cloud-music-gtk mpd, ncmpcpp, mpc, Netease-cloud-music-gtk
Media Player mpv mpv
Text Editor Neovim Neovim
Icons Papirus Papirus
Fonts Nerd fonts Nerd fonts
Image Viewer imv feh
Screenshot Software grimshot,grimblast flameshot
Screen Recording wf-recorder, OBS OBS
Clipboard wl-clipboard xclip
Color Picker hyprpicker

窗口管理器

sway & hyprland

a.mp4

sway 与 hyprland 外观一致,此处展示的是 hyprland

bspwm

动画极为流畅,只是录制视频有点卡卡的样子

2023-02-22.22-36-48.mp4

主题

hyprland & sway

Load (Click to expand)

catppuccin-light 2023-01-12T02:21:59

catppuccin-dark 2023-01-12T03:00:29

nord 2023-01-17T00:15:22

bspwm

Load (Click to expand)

2023-02-22_21-30

目录结构

├── blog
│  ├── archetypes
│  ├── assets
│  ├── content
│  ├── layouts
│  ├── static
│  └── themes
├── hosts
│  ├── laptop
│  └── server
├── modules
│  ├── desktop
│  ├── devlop
│  ├── editors
│  ├── environment
│  ├── fonts
│  ├── hardware
│  ├── programs
│  ├── scripts
│  ├── shell
│  ├── theme
│  └── virtualisation
├── overlays
│  ├── cinnamon.nemo
│  └── flameshot
├── pkgs
│  ├── catppuccin-cursors
│  ├── catppuccin-frappe-gtk
│  ├── catppuccin-latte-gtk
│  ├── fcitx5-pinyin-moegirl
│  ├── fcitx5-pinyin-zhwiki
│  ├── go-musicfox
│  └── swww
└── secrets
   └── _public_keys_

如何安装?

最小安装(包含 wm,没有 tmpfs as root),前往此处

如何安装?(root on tmpfs)

  1. 准备一个 64 位的 nixos minimal iso image 烧录好,然后进入 live 系统。假设我已经分好两个分区/dev/nvme0n1p1 /dev/nvme0n1p3
  2. 格式化分区
  mkfs.fat -F 32 /dev/nvme0n1p1
  mkfs.ext4 /dev/nvme0n1p3
  1. 挂载
  mount -t tmpfs none /mnt
  mkdir -p /mnt/{boot,nix,etc/nixos}
  mount /dev/nvme0n1p3 /mnt/nix
  mount /dev/nvme0n1p1 /mnt/boot
  mkdir -p /mnt/nix/persist/etc/nixos
  mount -o bind /mnt/nix/persist/etc/nixos /mnt/etc/nixos
  1. 生成一个基本的配置
  nixos-generate-config --root /mnt
  1. 克隆仓库到本地
nix-shell -p git
git clone  https://github.com/Ruixi-rebirth/flakes.git /mnt/etc/nixos/Flakes
cd  /mnt/etc/nixos/Flakes/
nix develop --extra-experimental-features nix-command --extra-experimental-features flakes
  1. 将 /mnt/etc/nixos 中的 hardware-configuration.nix 拷贝到 /mnt/etc/nixos/Flakes/hosts/laptop/hardware-configuration.nix
cp /mnt/etc/nixos/hardware-configuration.nix /mnt/etc/nixos/Flakes/hosts/laptop/hardware-configuration.nix
  1. 修改被覆盖后的 hardware-configuration.nix
nvim /mnt/etc/nixos/Flakes/hosts/laptop/hardware-configuration.nix
...
#这只是一个例子
#请参考 `https://elis.nu/blog/2020/05/nixos-tmpfs-as-root/#step-4-1-configure-disks`

  fileSystems."/" =
    { device = "none";
      fsType = "tmpfs";
      options = [ "defaults" "size=8G" "mode=755"  ];
    };

  fileSystems."/nix" =
    { device = "/dev/disk/by-uuid/49e24551-c0e0-48ed-833d-da8289d79cdd";
      fsType = "ext4";
    };

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/3C0D-7D32";
      fsType = "vfat";
    };

  fileSystems."/etc/nixos" =
    { device = "/nix/persist/etc/nixos";
      fsType = "none";
      options = [ "bind" ];
    };
...
  1. 移除 '/mnt/etc/nixos/Flakes/.git'
rm -rf .git
  1. 用户名修改: 编辑 /mnt/etc/nixos/Flakes/flake.nix 修改 user 变量,主机名修改: 编辑 /mnt/etc/nixos/Flakes/hosts/system.nix 修改 networking 属性组中的 hostName

  2. 使用 mkpasswd {PASSWORD} -m sha-512 命令生成的密码哈希串替换掉 /mnt/etc/nixos/Flakes/hosts/laptop/wayland/default.nix 中的 users.users.<name>.hashedPassword 值替换掉。(在文件中有两处需要替换的内容)

  3. 选择 Window Manager

    Wayland: 这行这行 取消注释, 并且注释 这行这行

Hyprland: 如果 这行这行 有注释, 则均取消注释, 并且注释掉下面涉及到 sway 的两行

Sway: 如果 这行这行 有注释, 则均取消注释, 并且注释掉上面涉及到 hyprland 的两行

Xorg: 这行这行 取消注释, 并且注释 这行这行

Bspwm: 默认

  1. 选择主题

    Wayland

这里 任意选择一个

Xorg

nord: 默认

  1. 安装
nixos-install --no-root-passwd --flake .#laptop

#或者指定源:
nixos-install --option substituters "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" --no-root-passwd --flake .#laptop
  1. 重启
reboot
  1. 享受它吧!

melted-flakes's People

Contributors

dependabot[bot] avatar hertz-hwang avatar ruixi-rebirth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

melted-flakes's Issues

请问如何添加自定义 module 呢

您好 我希望在自己的 flake 文件内

添加 clash-verge module 的 module

我尝试在 module/new_module.nix 添加该 module 文件

并 在 hosts/laptop/wayland/home.nix 添加添加该 module 的引用

但会提示 error: getting status of '/nix/store/ix94dw9820bsavmk7dnlm55smyjj2fq3-source/modules/new_module': No such file or directory

因为我对 nix 语法不是很熟悉 刚接触 查找 自定义 module 的教程 在 flake.nix 文件 等 直接添加 我都失败了

所以来此向您请教 打扰到您十分抱歉

安装最后出现异常

[root@nixos:/mnt/etc/nixos/Flakes]# nixos-install --no-root-passwd --flake .#laptop
copying channel...
building the flake in path:/mnt/etc/nixos/Flakes?lastModified=1674970372&narHash=sha256-%2f4X4LeiH2mlIBAzuNcp5qKq6mHqMUhIKDxBF%2fNPXk4Q=...
error: filesystem error: cannot rename: Invalid cross-device link [/mnt/nix/store/agmwgn30l3n8ivkk9mvs04s4gp3pxhkq-3270.zip.drv.chroot/nix/store/2xqbcb50cwik4rdm6xza0ywg9izs1q0z-3270.zip] [/nix/store/2xqbcb50cwik4rdm6xza0ywg9izs1q0z-3270.zip]

image

Hello, I meet this case, i don't have file Laptop

i don't have file laptop in this case
" cp /mnt/etc/nixos/hardware-configuration.nix /mnt/etc/nixos/Flakes/hosts/laptop/hardware-configuration.nix "
i have been create file laptop and " cp /mnt/etc/nixos/hardware-configuration.nix to laptop "

I'm quite confused when using this command and did it like this
_**{ inputs
, sharedModules
, homeImports
, user
, ...
}: {
flake.nixosConfigurations =
let
inherit (inputs.nixpkgs.lib) nixosSystem;
in
{
k-on = nixosSystem {
specialArgs = { inherit user; };
modules =
[
./k-on
../modules/lanzaboote.nix
# ../modules/impermanence.nix
../modules/desktop.nix
../modules/fonts.nix
../modules/virtualisation
{ home-manager.users.${user}.imports = homeImports."${user}@K-ON"; }
]
++ sharedModules;
};
minimal = nixosSystem {
specialArgs = { inherit user; };
modules =
[
./minimal
../modules/impermanence.nix
../modules/systemdboot.nix
../modules/impermanence.nix

      ] ++ sharedModules;
  };

#};
}**_

i have access into this file
"8. Username modification: edit /mnt/etc/nixos/Flakes/flake.nix to modify user variable, hostname modification: edit /mnt/etc/nixos/Flakes/hosts/system.nix to modify* The hostName value in the networking property group"
"9. Use the hash password generated by the mkpasswd {PASSWORD} -m sha-512 command to replace the value of users.users..hashedPassword in /mnt/etc/nixos/Flakes/hosts/laptop/wayland/default.nix ( there is two place needs to be displace ) "

but it empty, should i skip this step.

I have been install " nixos-install --no-root-passwd --flake .#laptop " then reboot but It is still a minimal console and and requires login. I don't know what to enter into it.

Can i install it after installing nixos minial ?
Sorry if I bother you. Looking forward to your and everyone's help.

Editing the config

I want to switch to NixOS but am somewhat new to linux and NixOS seems very confusing. Let's say if i wanted to use my own hyprland or sway config that I'm already used to and if i also wanted to remove a few apps that your config installs, how would i do that?

您似乎装了两个hyprland?

在抄袭您的配置的时候,我发现,您先在这里定义了pkgs,然后在这里写waybar的patch时,使用了pkgs.hyprland的hyprctl,也就引入了nixpkgs.hyprland这个较旧的包;而由于导入了hyprland的module,在这里enable hyprland时,是使用的hyprland上游的最新版。这会导致系统中同时安装两个版本,虽然旧版的hyprctl ipc可能确实兼容新版的hyprland。

`git-shell -p git` dependencies of derivation... failed to build问题

我是用的最小安装包在纯终端中安装的。 在运行git-shell -p git后会提示:
image

就算加了镜像还是这样,如:git-shell -p git --option substituters "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store".

关于这类问题,我有考虑过是否需要用代理:于是git-shell -p clash, 但是遗憾也是同样的问题,装不上。

网络链接问题,墙与不可抗力

nix-shell -p git
git clone https://github.com/Ruixi-rebirth/flakes.git /mnt/etc/nixos/Flakes
cd /mnt/etc/nixos/Flakes/
nix develop --extra-experimental-features nix-command --extra-experimental-features flakes

需要翻墙,但安装镜像里面无法下载开启v2raya等代理服务( modify /etc/nixos/configration.nix cannot rebuild iso...)
is there any way to slove this?

btw, it seems readme.md is out of time as others .nix files has been modified.
one of bilibili fans.

Build failed

When I tried to build the NixOS on VMware, it failed. Is it a problem of VM? Maybe I will try it on a real laptop. But I'm scared for the problem happening again.

[(Flakes)$:/mnt/etc/nixos/Flakes]$ nixos-install --no-root-passwd --flake .#laptop
copying channel...
building the flake in path:/mnt/etc/nixos/Flakes?lastModified=1684762385&narHash=sha256-2m%2fbM1UPmdw1ZK+RNam%2fWOUveIBJI4FfPL1JQSU8KeU=...
error: builder for '/nix/store/ik4kgzv6dpnw0pxx3igr7g99nf5lzird-nerdfonts-2.3.3.drv' failed with exit code 1;
       last 10 log lines:
       >   inflating: Lilex Light Nerd Font Complete Mono Windows Compatible.ttf
       >   inflating: Lilex Light Nerd Font Complete Mono.ttf
       >   inflating: Lilex Light Nerd Font Complete Windows Compatible.otf
       > Lilex Light Nerd Font Complete Windows Compatible.otf:  write error (disk full?).  Continue? (y/n/^C)
       > warning:  Lilex Light Nerd Font Complete Windows Compatible.otf is probably truncated
       > replace Lilex Bold Nerd Font Complete Mono Windows Compatible.ttf? [y]es, [n]o, [A]ll, [N]one, [r]ename:  NULL
       > (EOF or read error, treating as "[N]one" ...)
       > Lilex Regular Nerd Font Complete Windows Compatible.otf:  write error (disk full?).  Continue? (y/n/^C)
       > warning:  Lilex Regular Nerd Font Complete Windows Compatible.otf is probably truncated
       > do not know how to unpack source archive /nix/store/x3qiwr42s2hj25sabm83dsz07d9j8hly-Lilex.zip
       For full logs, run 'nix log /nix/store/ik4kgzv6dpnw0pxx3igr7g99nf5lzird-nerdfonts-2.3.3.drv'.
       note: build failure may have been caused by lack of free disk space
error: 1 dependencies of derivation '/nix/store/z5aawywnb18kjqyp5n0ndpk8pg6i951a-fc-00-nixos-cache.conf.drv' failed to build
error: 1 dependencies of derivation '/nix/store/arnxpcfylw6ckzahyrdmqk90ly1ihbcd-fontconfig-conf.drv' failed to build
error: 1 dependencies of derivation '/nix/store/8xyy89lnwiad8s2wcfqi1jaln9ihx4jl-fontconfig-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/8d3ylq2p6437ws7rx5xrczh1cnimxlij-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/168sm5fhq31f8x4pss3swk4svykbypcm-nixos-system-nixos-23.05.20230422.6c43a34.drv' failed to build
[(Flakes)$:/mnt/etc/nixos/Flakes]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        397M     0  397M   0% /dev
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           2.0G   11M  2.0G   1% /run
tmpfs           3.9G  384K  3.9G   1% /run/wrappers
tmpfs           3.9G   33M  3.9G   1% /
/dev/root       837M  837M     0 100% /iso
/dev/loop0      804M  804M     0 100% /nix/.ro-store
tmpfs           3.9G  1.3G  2.7G  32% /nix/.rw-store
overlay         3.9G  1.3G  2.7G  32% /nix/store
tmpfs           793M     0  793M   0% /run/user/1000
/dev/sda1       118G   24G   89G  22% /mnt
/dev/sda3       487M  4.0K  487M   1% /mnt/boot
[(Flakes)$:/mnt/etc/nixos/Flakes]$

Help

I get this error, file system error cannot rename: Invalid cross device link

安装完毕后出现的一些问题

我使用默认的配置 根据 README 教程进行了安装 只是将 nixos的分区 从 ext4 分区 换成了 btrfs 而已 已经可以正常进系统了

但 无法使用 sudo 等命令 目前暂时发现 sudo clear 无法使用
2023-04-07_14-32
而且无法找到 /nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite 文件
桌面壁纸 不知道是原本就没有 还是怎么的 我直接是一个 黑色壁纸

我以为可能是 flakes 不是最新的缘故 所以会这样
就在 /etc/nixos/Flakes 文件夹下 以 root 用户
执行

nix flake --update
nixos-rebuild swith -flake '.#laptop'

以进行更新 但发现 neovim 一直无法成功编译 一直提示 undefined reference to'ts_tree_included_ranges'
2023-04-07_14-39
我以为可能是 没找到 tree_sitter 包 就执行 nix-shell -p tree_sitter 来进行 rebuild 还是一样

在安装过程中出现raw.githubusercontent 相关报错的解决办法

近日尝试在本机上完成本配置文件的编译,但是总是会遇到一些奇怪的问题,其中之一就是最为常见的raw.githubusercontent.com报错
但是,因为NixOS的特性,没有办法通过修改/etc/hosts的文件来完成对应操作,想着顺藤摸瓜过去直接修改源文件吧,也不行。

最终尝试通过修改HOSTALIASES环境变量的方法实现相关操作

  1. 通过手动CP内容的方式将/etc/hosts文件的内容转移到某个位置的文件中(不可以直接cp实现,这样获得的文件仍然是不可修改的)
  2. 添加你想要加的条目
  3. export HOSTALIASES=~/hosts(你复制的这个新的host文件)

nixos-generate-config --root /mnt 报错

nixos-generate-config --root /mnt 报错如下

ERROR: Not a Btrfs filesystem: Invalid argument
writing /mnt/etc/nixos/hardware-configuration.nix...
warning: not overwriting existing /mnt/etc/nixos/configuration.nix

建议修改为 nixos-generate-config --root --dir=/mnt

与网络链接相关的问题

在使用网络链接的时候,通过win运行Advanced Network Configuration程序,在打开的窗口中正常添加新的WIFI,一直会报错Insufficient privileges,而且无论如何完善内容也无法解决

  1. 通过STFW找到相关内容发现我的操作步骤正确
  2. 通过简单的搜索,了解到了在整个NetworkManager的操作过程中 nm-connection-editor 是提供窗口化程序的,遂直接在fish终端中运行nm-connection-editor果真能够正常使用。

感觉可能是客制化颜色打包的时候出现的问题?

failed to build

安装有报错呢大佬,我ustc源和sjtu源都试了,好像找不到一个叫emanote的包还是这么的,官方源报错更多
`

trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05
trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05
trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05
error: unable to download 'https://mirror.sjtu.edu.cn/nix-channels/store/nar/1v8r0dnqlhxkyk2vvqh115f5hvl21ywdbczaz70i02jgkva98vxx.nar.xz': HTTP error 200 (curl error: Transferred a partial file)
error: some substitutes for the outputs of derivation '/nix/store/cg669ar3bpy6swj2lxbqncj6p6524mis-emanote-1.0.2.0.drv' failed (usually happens due to networking issues); try '--fallback' to build derivation from source
error: some substitutes for the outputs of derivation '/nix/store/k1qlhzbhajjhawzjcypb1xnyihy2srd2-haskell-language-server-2.0.0.0.drv' failed (usually happens due to networking issues); try '--fallback' to build derivation from source
error: 1 dependencies of derivation '/nix/store/49bqdk1if8d7j9zkfbsjk5jhm4x7yjm1-emanote-1.0.2.0-fish-completions.drv' failed to build
error: 1 dependencies of derivation '/nix/store/niwhsbsijy1h2931zhfhlsmfhc52zbah-emanote.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/3xcxkxri1akhrcx3h2xgq1rvi46w45j4-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/sgw2a3zcdrkniacf0l2ll7g7si562ddc-man-paths.drv' failed to build
error: 1 dependencies of derivation '/nix/store/afzpd6rnkkziqwvk29qgg1ggcsnzivyb-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/1dq88nbkaar2l6b5wb6pnfmj9qypifgy-user-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/02ygn5q47jc47wd4jk2ym3nsmg820rfz-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/qlxhfnr8zdvwsb9qd1d3xfnfca7276ps-nixos-system-Edison-23.11.20230804.18036c0.drv' failed to build

`

No license

Upon reviewing your repository, I have noticed the absence of a license. As a conscientious user, I am keen on understanding the guidelines, permissions, and restrictions associated with the repository.

Could you kindly provide clarification on the do's and don'ts that should be adhered to when interacting with the contents of this repository?

How to update?

For users who are planning to use this flake as a long-term desktop.
How do we update?

I am new to NixOS, but the immutable and amnesiac (tmpfs on root) features are amazing.
How do I do the equivalent of pacman -Suy?

安装问题

我是个nixos小白,近日想尝试一下nixos,于是用VMware开了个虚拟机。
在live系统中安装,前面所有的都搞定了,最后install的时候提示空间不足。。。
然后重新用默认配置安装后,进入新系统,按在live系统中的操作重新搞了一遍,最后安装是安装成功了,但是重启后进不了图形界面。。。
想问下大佬是不是有些驱动需要删掉。
然后我看整个系统编译完成后占用有50多G,想问下大佬可否出个精简版本的,去掉特殊驱动、docker、开发软件、qq、微信之类的版本,只保留桌面环境和主题。能够减少一下尝鲜的人的编译压力。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.