Frost-Phoenix / nixos-config

❄️ NixOs / Hyprland rice with Home-Manager ❄️
MIT License
354 stars 35 forks source link

Sorry im noob in Nixos #21

Closed Dodo5393 closed 3 months ago

Dodo5393 commented 3 months ago

After installation how can i chainge config like language , keyboard layout ,and how can i install more app like spotify.

Frost-Phoenix commented 3 months ago

Hi,

After the installation is complete you will have to edit some files to change the config.

To change the language / time zone you need to edit lines 29 - 30 of ./modules/core/system.nix:

29   │   time.timeZone = "Europe/Paris";
30   │   i18n.defaultLocale = "en_US.UTF-8";

To add a program you can add it to the packages list in ./modules/home/packages.nix:

home.packages = (with pkgs; [
    ...
     spotify
    ...
]);

If you are not sure if a program is available or to find the correct name you can search it on https://search.nixos.org/packages.

And after you have done your modifications you need to use the nix-switch command (which is actually an alias that you can find in ./modules/home/zsh.nix), but this command will only work if you have clone the repo to your home directory.

Hope this can help you, if you need some more specific help you can contact me on discord (https://discord.com/users/593456700045000704) if you want or continue posting here :).

Dodo5393 commented 3 months ago

I have clone repo to user dir.

And I have edit my files like that: ./modules/home/packages.nix


   3   │   home.packages = (with pkgs; [
   4 + │     bitwarden-desktop
   5 + │     spotify
                  ....

./modules/core/system.nix

  29 ~ │   time.timeZone = "Europe/Warsaw";
  30 ~ │   i18n.defaultLocale = "pl_PL.UTF-8";

and after nix-switch i get

warning: Git tree '/home/dodo/nixos-config' is dirty
building the system configuration...
warning: Git tree '/home/dodo/nixos-config' is dirty
stopping the following units: NetworkManager-wait-online.service, NetworkManager.service, accounts-daemon.service, audit.service, auto-cpufreq.service, kmod-static-nodes.service, logrotate-checkconf.service, mount-pstore.service, network-local-commands.service, network-setup.service, nscd.service, resolvconf.service, spice-vdagentd.service, systemd-modules-load.service, systemd-oomd.service, systemd-oomd.socket, systemd-sysctl.service, systemd-timesyncd.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd.service
NOT restarting the following changed units: display-manager.service, getty@tty1.service, libvirt-guests.service, libvirtd.service, systemd-backlight@backlight:amdgpu_bl1.service, systemd-fsck@dev-disk-by\x2duuid-A411\x2dF875.service, systemd-journal-flush.service, systemd-logind.service, systemd-random-seed.service, systemd-remount-fs.service, systemd-update-utmp.service, systemd-user-sessions.service, user-runtime-dir@1000.service, user@1000.service
activating the configuration...
setting up /etc...
removing obsolete symlink ‘/etc/mdadm.conf’...
reloading user units for dodo...
restarting sysinit-reactivation.target
reloading the following units: dbus.service, firewall.service, reload-systemd-vconsole-setup.service
restarting the following units: home-manager-dodo.service, nix-daemon.service, polkit.service, systemd-journald.service
starting the following units: NetworkManager-wait-online.service, NetworkManager.service, accounts-daemon.service, audit.service, auto-cpufreq.service, kmod-static-nodes.service, logrotate-checkconf.service, mount-pstore.service, network-local-commands.service, network-setup.service, nscd.service, resolvconf.service, spice-vdagentd.service, systemd-modules-load.service, systemd-oomd.socket, systemd-sysctl.service, systemd-timesyncd.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket
the following new units were started: NetworkManager-dispatcher.service, sysinit-reactivation.target, systemd-hostnamed.service, systemd-tmpfiles-resetup.service
warning: the following units failed: alsa-store.service

× alsa-store.service - Store Sound Card State
     Loaded: loaded (/etc/systemd/system/alsa-store.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Sun 2024-06-23 13:17:53 CEST; 6s ago
    Process: 3911 ExecStartPre=/nix/store/i7qhgc0bs725qw3wdanznfkdna4z2ns2-coreutils-9.5/bin/mkdir -p /var/lib/alsa (code=exited, status=0/SUCCESS)
    Process: 3921 ExecStart=/nix/store/45r9a2zkbqzjvrz9fhcqns3ggljp7sfa-alsa-utils-1.2.10/sbin/alsactl restore --ignore (code=exited, status=99)
   Main PID: 3921 (code=exited, status=99)
         IP: 0B in, 0B out
        CPU: 15ms

Jun 23 13:17:53 nixos systemd[1]: Starting Store Sound Card State...
Jun 23 13:17:53 nixos alsactl[3921]: /nix/store/45r9a2zkbqzjvrz9fhcqns3ggljp7sfa-alsa-utils-1.2.10/sbin/alsactl: load_state:1689: Cannot open /var/lib/alsa/asound.state for reading: No such file or directory
Jun 23 13:17:53 nixos alsactl[3921]: Found hardware: "HDA-Intel" "ATI R6xx HDMI" "HDA:1002aa01,00aa0100,00100700" "0x103c" "0x8a1b"
Jun 23 13:17:53 nixos alsactl[3921]: Hardware is initialized using a generic method
Jun 23 13:17:53 nixos alsactl[3921]: Found hardware: "acp" "" "" "" ""
Jun 23 13:17:53 nixos alsactl[3921]: Hardware is initialized using a generic method
Jun 23 13:17:53 nixos systemd[1]: alsa-store.service: Main process exited, code=exited, status=99/n/a
Jun 23 13:17:53 nixos systemd[1]: alsa-store.service: Failed with result 'exit-code'.
Jun 23 13:17:53 nixos systemd[1]: Failed to start Store Sound Card State.
warning: error(s) occurred while switching to the new configuration
Dodo5393 commented 3 months ago

I fixed it, but after the conversion I don't have Polish characters on the keyboard

Frost-Phoenix commented 3 months ago

Sorry for the long response delay, I just found out how to do it. You need to edit two file and replace the fr with pl I believe for Polish keyboard:

First ./modules/core/xserver.nix:

   4   │     xserver = {
   5   │       enable = true;
   6   │       xkb.layout = "us,fr";
   7   │     };

And ./modules/home/hyprland/config.nix:

  23   │       input = {
  24   │         kb_layout = "us,fr";

With that you will be able to switch between us and plkeyboards by pressing alt+shift. And if you just want the Polish one you can remove the us, in both file altogether.

I hope this will help you.

Dodo5393 commented 3 months ago

Practically, I have a Polish layout on the keyboard:

  ➜ setxkbmap -query   

WARNING: Running setxkbmap against an Xwayland server
rules:      evdev
model:      pc105
layout:     pl

but technically I can't use the Polish character like ą, ć, ę, ł, ń, ó, ś, ź, ż, ł by adding alt to the letter.

Dodo5393 commented 3 months ago

thanks, now everything works properly. I really love this config, great job