メインコンテンツへスキップ
見出し画像

メイン機もNixOS 24.05にアップグレード(ではない)

    アップグレードではありません。クリーンインストールしました。

    configuration.nixの編集

    USBメモリで保管していた以前の設定ファイルを引っ張り出し、新しいconfiguration.nixにコピペしていきます。
    今回は追記・修正もしていきます。

    intelグラフィックドライバ

    nixpkgs.config.packageOverridesセクションが複数ヶ所にあると、ビルドで怒られます(失敗)。
    そのためSteamの豆腐日本語対策もここにまとめて書くことになりました。

    {
    
      ...
    
      nixpkgs.config.packageOverrides = pkgs: {
        intel-vaapi-driver = pkgs.intel-vaapi-driver.override {
          enableHybridCodec = true;
        };
        steam = pkgs.steam.override {
          extraPkgs = pkgs:
            with pkgs; [
              migu
            ];
        };
      };
    
      hardware.opengl = {
        enable = true;
        extraPackages = with pkgs; [
          intel-media-driver
          intel-vaapi-driver
          libvdpau-va-gl
        ];
      };
      environment.sessionVariables = {
        LIBVA_DRIVER_NAME = "iHD";
      };
    
      ...
    
    }


    configration.nixのナウな書き方

    このまま sudo nixos-rebuild switch コマンドでリビルドすると、冒頭で赤い字で何やら警告が流れます。一応ビルドは通りますが、いちいち鬱陶しいので対処します。

    キーマップ

    services.xserverの設定を書き換えます。コメントアウトした箇所は以前の書き方です。

    {
    
      ...
    
      # Configure keymap in X11
      # services.xserver = {
      services.xserver.xkb = {
        layout = "jp";
      # xkbVariant = "";
        variant = "";
      };
    
      ...
    
    }

    フォント

    fontsの設定を書き換えます。コメントアウトした箇所は以前の書き方です。

    {
    
      ...
    
      fonts = {
        # fonts = with pkgs; [
        packages= with pkgs; [
          noto-fonts-cjk-serif
          noto-fonts-cjk-sans
          noto-fonts-emoji
          nerdfonts
        ];
    
      ...
    
      };
    }

    パッケージ

    wget
    curl
    git
    docker-compose
    blueman

    Bluetoothを有効にするには下記リンクを参照してください。

    その他のアプリケーションは、Home Managerを使って導入します。

    Home Manager

    スタンドアローンで入れました。

    dotfiles

    home.nixのコメント行を参考に、vimrcだけ作りました。
    ~/.config/home-manager/dotfiles を作り、その中にvimrc(先頭のドット不要)を格納。ホームフォルダじゃないのね…

      # Home Manager is pretty good at managing dotfiles. The primary way to manage
      # plain files is through 'home.file'.
      home.file = {
        # # Building this configuration will create a copy of 'dotfiles/screenrc' in
        # # the Nix store. Activating the configuration will then make '~/.screenrc' a
        # # symlink to the Nix store copy.
        # ".screenrc".source = dotfiles/screenrc;
    
        # # You can also set the file content immediately.
        # ".gradle/gradle.properties".text = ''
        #   org.gradle.console=verbose
        #   org.gradle.daemon.idletimeout=3600000
        # '';
    
        ".vimrc".source = dotfiles/vim/vimrc;
      };

    Wikiにも何か書かれていますが、今後の参考に。

    これで現在、メインもサブもNixOSになりました。

    あなたへのおすすめ